summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-07-13 18:41:21 (GMT)
committerBrad King <brad.king@kitware.com>2016-07-13 18:41:21 (GMT)
commitaec3c79acbe86a2156e3929678ef05bc2840edfa (patch)
treea013f056b5c58d43d47f599b243d9e5a9a06c834
parent53df6d5995bef4a4884ede870c7b904033395ce2 (diff)
downloadCMake-aec3c79acbe86a2156e3929678ef05bc2840edfa.zip
CMake-aec3c79acbe86a2156e3929678ef05bc2840edfa.tar.gz
CMake-aec3c79acbe86a2156e3929678ef05bc2840edfa.tar.bz2
Strip CMAKE_*_LINKER_FLAGS[_<CONFIG>] initializer whitespace
-rw-r--r--Modules/CMakeCommonLanguageInclude.cmake14
1 files changed, 9 insertions, 5 deletions
diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake
index fa025a8..6b37208 100644
--- a/Modules/CMakeCommonLanguageInclude.cmake
+++ b/Modules/CMakeCommonLanguageInclude.cmake
@@ -16,11 +16,15 @@
# cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language.
-if(NOT "x$ENV{LDFLAGS}" STREQUAL "x")
- set (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
- set (CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
- set (CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
-endif()
+set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
+set(CMAKE_SHARED_LINKER_FLAGS_INIT "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
+set(CMAKE_MODULE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}")
+
+foreach(t EXE SHARED MODULE STATIC)
+ foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_${t}_LINKER_FLAGS${c}_INIT}" CMAKE_${t}_LINKER_FLAGS${c}_INIT)
+ endforeach()
+endforeach()
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none