summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-15 13:04:30 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-07-15 13:04:30 (GMT)
commitc8e59d2dfa7cc716d11b9e32fdc6f2302e4cbe69 (patch)
tree1104617f21961637bd076836f3ae2bfa547bb1f8 /Tests
parent595cbb493fcdbdae30ac5936c3bdfdedd75a19e7 (diff)
parent8a98cf643235a4d2869e1c876f8769b3e6bcd86f (diff)
downloadCMake-c8e59d2dfa7cc716d11b9e32fdc6f2302e4cbe69.zip
CMake-c8e59d2dfa7cc716d11b9e32fdc6f2302e4cbe69.tar.gz
CMake-c8e59d2dfa7cc716d11b9e32fdc6f2302e4cbe69.tar.bz2
Merge topic 'toolchain-flag-init'
8a98cf64 Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files 37d15c39 MSVC: Set all CMAKE_*_LINKER_FLAGS_INIT directly 55c884ed Embarcadero: Set all CMAKE_*_LINKER_FLAGS_INIT directly aec3c79a Strip CMAKE_*_LINKER_FLAGS[_<CONFIG>] initializer whitespace
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/ToolchainFile/LinkFlagsInit-stdout.txt60
-rw-r--r--Tests/RunCMake/ToolchainFile/LinkFlagsInit-toolchain.cmake5
-rw-r--r--Tests/RunCMake/ToolchainFile/LinkFlagsInit.cmake7
-rw-r--r--Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake1
4 files changed, 73 insertions, 0 deletions
diff --git a/Tests/RunCMake/ToolchainFile/LinkFlagsInit-stdout.txt b/Tests/RunCMake/ToolchainFile/LinkFlagsInit-stdout.txt
new file mode 100644
index 0000000..0ddf7d2
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/LinkFlagsInit-stdout.txt
@@ -0,0 +1,60 @@
+-- CMAKE_EXE_LINKER_FLAGS='[^
+]*MY_EXE_FLAGS_INIT[^
+]*'
+-- CMAKE_EXE_LINKER_FLAGS_DEBUG='[^
+]*MY_EXE_FLAGS_DEBUG_INIT[^
+]*'
+-- CMAKE_EXE_LINKER_FLAGS_RELEASE='[^
+]*MY_EXE_FLAGS_RELEASE_INIT[^
+]*'
+-- CMAKE_EXE_LINKER_FLAGS_MINSIZEREL='[^
+]*MY_EXE_FLAGS_MINSIZEREL_INIT[^
+]*'
+-- CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO='[^
+]*MY_EXE_FLAGS_RELWITHDEBINFO_INIT[^
+]*'
+-- CMAKE_SHARED_LINKER_FLAGS='[^
+]*MY_SHARED_FLAGS_INIT[^
+]*'
+-- CMAKE_SHARED_LINKER_FLAGS_DEBUG='[^
+]*MY_SHARED_FLAGS_DEBUG_INIT[^
+]*'
+-- CMAKE_SHARED_LINKER_FLAGS_RELEASE='[^
+]*MY_SHARED_FLAGS_RELEASE_INIT[^
+]*'
+-- CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL='[^
+]*MY_SHARED_FLAGS_MINSIZEREL_INIT[^
+]*'
+-- CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO='[^
+]*MY_SHARED_FLAGS_RELWITHDEBINFO_INIT[^
+]*'
+-- CMAKE_MODULE_LINKER_FLAGS='[^
+]*MY_MODULE_FLAGS_INIT[^
+]*'
+-- CMAKE_MODULE_LINKER_FLAGS_DEBUG='[^
+]*MY_MODULE_FLAGS_DEBUG_INIT[^
+]*'
+-- CMAKE_MODULE_LINKER_FLAGS_RELEASE='[^
+]*MY_MODULE_FLAGS_RELEASE_INIT[^
+]*'
+-- CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL='[^
+]*MY_MODULE_FLAGS_MINSIZEREL_INIT[^
+]*'
+-- CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO='[^
+]*MY_MODULE_FLAGS_RELWITHDEBINFO_INIT[^
+]*'
+-- CMAKE_STATIC_LINKER_FLAGS='[^
+]*MY_STATIC_FLAGS_INIT[^
+]*'
+-- CMAKE_STATIC_LINKER_FLAGS_DEBUG='[^
+]*MY_STATIC_FLAGS_DEBUG_INIT[^
+]*'
+-- CMAKE_STATIC_LINKER_FLAGS_RELEASE='[^
+]*MY_STATIC_FLAGS_RELEASE_INIT[^
+]*'
+-- CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL='[^
+]*MY_STATIC_FLAGS_MINSIZEREL_INIT[^
+]*'
+-- CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO='[^
+]*MY_STATIC_FLAGS_RELWITHDEBINFO_INIT[^
+]*'
diff --git a/Tests/RunCMake/ToolchainFile/LinkFlagsInit-toolchain.cmake b/Tests/RunCMake/ToolchainFile/LinkFlagsInit-toolchain.cmake
new file mode 100644
index 0000000..ca908ae
--- /dev/null
+++ b/Tests/RunCMake/ToolchainFile/LinkFlagsInit-toolchain.cmake
@@ -0,0 +1,5 @@
+foreach(t EXE SHARED MODULE STATIC)
+ foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ set(CMAKE_${t}_LINKER_FLAGS${c}_INIT MY_${t}_FLAGS${c}_INIT)
+ endforeach()
+endforeach()
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()
diff --git a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
index 88c8216..8a20200 100644
--- a/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ToolchainFile/RunCMakeTest.cmake
@@ -8,3 +8,4 @@ endfunction()
run_cmake_toolchain(CallEnableLanguage)
run_cmake_toolchain(CallProject)
run_cmake_toolchain(FlagsInit)
+run_cmake_toolchain(LinkFlagsInit)