summaryrefslogtreecommitdiffhomepage
path: root/cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-05-12 15:41:22 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-05-12 15:41:22 +0200
commit29ddc08ff2b5e8161f8c342cdb8fdafc9aa4a639 (patch)
tree43cfc59c5b1de5e918d024c571386037140a693a /cmake
parentd160fbec0c70095b725d612458ae9ee3aa8ed526 (diff)
cmake: don't relink when no headers change
This makes release builds hella fast.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index 35ef1d22..821de1ba 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -128,11 +128,12 @@ endfunction()
function(otr_module n_)
message(STATUS "module ${n_}")
cmake_parse_arguments(arg
- "STATIC;NO-COMPAT;BIN;EXECUTABLE;NO-QT;WIN32-CONSOLE;NO-INSTALL"
+ "STATIC;NO-COMPAT;BIN;EXECUTABLE;NO-QT;WIN32-CONSOLE;NO-INSTALL;RELINK"
"LINK;COMPILE"
"SOURCES"
${ARGN}
)
+
if(NOT "${arg_UNPARSED_ARGUMENTS}" STREQUAL "")
message(FATAL_ERROR "otr_module bad formals: ${arg_UNPARSED_ARGUMENTS}")
endif()
@@ -166,6 +167,12 @@ function(otr_module n_)
add_library(${n} ${link-mode} "${${n}-all}")
endif()
+ if(NOT arg_RELINK)
+ set_property(TARGET ${n} PROPERTY LINK_DEPENDS_NO_SHARED TRUE)
+ else()
+ set_property(TARGET ${n} PROPERTY LINK_DEPENDS_NO_SHARED FALSE)
+ endif()
+
if(NOT arg_NO-QT)
target_link_libraries(${n} ${MY_QT_LIBS})
endif()