summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2015-06-10 19:00:48 +0200
committerStanislaw Halik <sthalik@misaki.pl>2015-06-10 19:00:48 +0200
commitb957db4806b5cb02504535db72f4d891bc3528e2 (patch)
treedf7fc3de47e702f69a154b3a808cf9e74c700c57
parente324873fefce3a6aef8919861cf17862d1645823 (diff)
pass GNU ld arguments as GNU-LINK keyword
Don't switch if toolchain is GNU at call sites, conditionalize for opentrack_library macro
-rw-r--r--CMakeLists.txt12
1 files changed, 4 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4118d9d7..55f715b6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -81,7 +81,7 @@ macro(opentrack_qt n)
endmacro()
macro(opentrack_library n dir)
- cmake_parse_arguments(foolib "" "LINK;COMPILE" "" ${ARGN})
+ cmake_parse_arguments(foolib "" "LINK;COMPILE;GNU-LINK;GNU-COMPILE" "" ${ARGN})
if(NOT " ${foolib_UNPARSED_ARGUMENTS}" STREQUAL " ")
message(FATAL_ERROR "opentrack_library bad formals")
endif()
@@ -91,8 +91,8 @@ macro(opentrack_library n dir)
target_link_libraries(${n} ${MY_QT_LIBS})
if(CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
SET_TARGET_PROPERTIES(${n} PROPERTIES
- LINK_FLAGS "${foolib_LINK} -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack/${version-script}-version-script.txt\""
- COMPILE_FLAGS "${foolib_COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden"
+ LINK_FLAGS "${foolib_LINK} ${foolib_GNU-LINK} -Wl,--version-script=\"${CMAKE_SOURCE_DIR}/opentrack/${version-script}-version-script.txt\""
+ COMPILE_FLAGS "${foolib_COMPILE} ${foolib_GNU-COMPILE} -fvisibility=hidden -fvisibility-inlines-hidden"
)
else()
set_target_properties(${n} PROPERTIES LINK_FLAGS ${foolib_LINK} COMPILE_FLAGS ${foolib_COMPILE})
@@ -243,11 +243,7 @@ opentrack_library(opentrack-filter-ewma ftnoir_filter_ewma2)
opentrack_library(opentrack-proto-fgfs ftnoir_protocol_fg)
if(SDK_VJOY)
- set(link-flags)
- if(CMAKE_COMPILER_IS_GNUCC)
- set(link-flags "-Wl,--enable-stdcall-fixup")
- endif()
- opentrack_library(opentrack-proto-vjoy ftnoir_protocol_vjoy LINK ${link-flags})
+ opentrack_library(opentrack-proto-vjoy ftnoir_protocol_vjoy GNU-LINK "-Wl,--enable-stdcall-fixup")
target_link_libraries(opentrack-proto-vjoy ${MY_QT_LIBS} ${SDK_VJOY}/VJoy.dll)
target_include_directories(opentrack-proto-vjoy SYSTEM PUBLIC ${SDK_VJOY})
endif()