summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:02:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:53:40 +0200
commit7868302f5611606883e5eddd640ee806bf192481 (patch)
treee60c4a3c0f26f3a20688451ed44bb4faddcbe792
parentd2d63793c3ce266a5fe394ce2c098248469c06f5 (diff)
x-plane-plugin: fix ldflags logic for clang
-rw-r--r--x-plane-plugin/CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/x-plane-plugin/CMakeLists.txt b/x-plane-plugin/CMakeLists.txt
index de17b60d..af17ae97 100644
--- a/x-plane-plugin/CMakeLists.txt
+++ b/x-plane-plugin/CMakeLists.txt
@@ -6,14 +6,19 @@ if(LINUX OR APPLE)
# probably librt already included
install(FILES ${opentrack-xplane-plugin-c} DESTINATION "${opentrack-doc-src-pfx}/opentrack-xplane-plugin")
target_include_directories(opentrack-xplane-plugin SYSTEM PUBLIC ${SDK_XPLANE}/CHeaders ${SDK_XPLANE}/CHeaders/XPLM)
+
set(begin TARGET opentrack-xplane-plugin APPEND_STRING PROPERTY)
- if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
- set_property(${begin} COMPILE_FLAGS "-O2 -pipe -fPIC -DLIN -DXPLM200 -DXPLM210")
- set_property(${begin} LINK_FLAGS "-shared -rdynamic -nodefaultlibs -undefined_warning -fPIC")
- elseif(APPLE)
+ if(APPLE)
set_property(${begin} COMPILE_FLAGS "-iframework ${SDK_XPLANE}/Libraries/Mac/ -DAPL -DXPLM200 -DXPLM210 -framework XPLM -framework XPWidgets")
set_property(${begin} LINK_FLAGS "-F${SDK_XPLANE}/Libraries/Mac/ -framework XPLM -framework XPWidgets")
+ elseif(CMAKE_COMPILER_IS_GNUCXX)
+ set_property(${begin} COMPILE_FLAGS "-fPIC -DLIN -DXPLM200 -DXPLM210")
+ set_property(${begin} LINK_FLAGS "-rdynamic -nodefaultlibs -fPIC")
+ endif()
+
+ if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_COMPILER_IS_CLANG)
+ set_property(${begin} LINK_FLAGS "-undefined_warning")
endif()
set_target_properties(opentrack-xplane-plugin PROPERTIES