summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-13 19:06:23 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-14 19:47:32 (GMT)
commit8a98cf643235a4d2869e1c876f8769b3e6bcd86f (patch)
tree7c324e9cb4cf3842163a544bd679b4e167dc4c83 /Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake
parent37d15c399e33f3140c1ab0259984c54084dc34f8 (diff)
downloadCMake-8a98cf643235a4d2869e1c876f8769b3e6bcd86f.zip
CMake-8a98cf643235a4d2869e1c876f8769b3e6bcd86f.tar.gz
CMake-8a98cf643235a4d2869e1c876f8769b3e6bcd86f.tar.bz2
Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables. Change our convention for setting these variables from: set(CMAKE_EXE_LINKER_FLAGS_INIT "...") to string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ...") so that any value previously set by a toolchain file will be used.
Diffstat (limited to 'Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake')
-rw-r--r--Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake b/Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake
new file mode 100644
index 0000000..069d741
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake
@@ -0,0 +1,7 @@
+set(CMAKE_C_COMPILER_FORCED 1) # skip compiler test so we can check cached values
+enable_language(C)
+foreach(t EXE SHARED MODULE STATIC)
+ foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ message(STATUS "CMAKE_${t}_LINKER_FLAGS${c}='${CMAKE_${t}_LINKER_FLAGS${c}}'")
+ endforeach()
+endforeach()