summaryrefslogtreecommitdiffstats
path: root/Modules
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 /Modules
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 'Modules')
-rw-r--r--Modules/Platform/AIX-GNU.cmake6
-rw-r--r--Modules/Platform/AIX-XL.cmake6
-rw-r--r--Modules/Platform/CYGWIN-GNU.cmake2
-rw-r--r--Modules/Platform/Windows-Embarcadero.cmake6
-rw-r--r--Modules/Platform/Windows-MSVC.cmake12
-rw-r--r--Modules/Platform/Windows-OpenWatcom.cmake10
6 files changed, 21 insertions, 21 deletions
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake
index d6f5331..df97ab1 100644
--- a/Modules/Platform/AIX-GNU.cmake
+++ b/Modules/Platform/AIX-GNU.cmake
@@ -21,9 +21,9 @@ set(__AIX_COMPILER_GNU 1)
#
# By default, runtime linking is enabled. All shared objects specified on the command line
# will be listed, even if there are no symbols referenced, in the output file.
-set (CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-brtl")
-set (CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-brtl")
-set (CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-brtl")
+string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl")
+string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl")
+string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
macro(__aix_compiler_gnu lang)
diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake
index 5470441..3be095e 100644
--- a/Modules/Platform/AIX-XL.cmake
+++ b/Modules/Platform/AIX-XL.cmake
@@ -21,9 +21,9 @@ set(__AIX_COMPILER_XL 1)
#
# By default, runtime linking is enabled. All shared objects specified on the command line
# will be listed, even if there are no symbols referenced, in the output file.
-set(CMAKE_SHARED_LINKER_FLAGS_INIT "-Wl,-brtl")
-set(CMAKE_MODULE_LINKER_FLAGS_INIT "-Wl,-brtl")
-set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,-brtl")
+string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " -Wl,-brtl")
+string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " -Wl,-brtl")
+string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,-brtl")
macro(__aix_compiler_xl lang)
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake
index 1a46c10..5090c08 100644
--- a/Modules/Platform/CYGWIN-GNU.cmake
+++ b/Modules/Platform/CYGWIN-GNU.cmake
@@ -19,7 +19,7 @@ endif()
set(__CYGWIN_COMPILER_GNU 1)
# TODO: Is -Wl,--enable-auto-import now always default?
-set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--enable-auto-import")
+string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " -Wl,--enable-auto-import")
set(CMAKE_CREATE_WIN32_EXE "-mwindows")
set(CMAKE_GNULD_IMAGE_VERSION
diff --git a/Modules/Platform/Windows-Embarcadero.cmake b/Modules/Platform/Windows-Embarcadero.cmake
index 79b0af5..43ae2a3 100644
--- a/Modules/Platform/Windows-Embarcadero.cmake
+++ b/Modules/Platform/Windows-Embarcadero.cmake
@@ -65,9 +65,9 @@ set (CMAKE_BUILD_TYPE Debug CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
foreach(t EXE SHARED MODULE)
- set(CMAKE_${t}_LINKER_FLAGS_INIT "${_tM} -lS:1048576 -lSc:4098 -lH:1048576 -lHc:8192 ")
- set(CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT "-v")
- set(CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT "-v")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_tM} -lS:1048576 -lSc:4098 -lH:1048576 -lHc:8192 ")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " -v")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " -v")
endforeach()
# The Borland link tool does not support multiple concurrent
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index 4184675..14d4c9b 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -252,15 +252,15 @@ endif()
foreach(t EXE SHARED MODULE)
string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- set(CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
- set(CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " /debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " /debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
else ()
- set(CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
- set(CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_DEBUG_INIT " /debug ${MSVC_INCREMENTAL_YES_FLAG}")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_RELWITHDEBINFO_INIT " /debug ${MSVC_INCREMENTAL_YES_FLAG}")
endif ()
# for release and minsize release default to no incremental linking
- set(CMAKE_${t}_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
- set(CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_MINSIZEREL_INIT " /INCREMENTAL:NO")
+ string(APPEND CMAKE_${t}_LINKER_FLAGS_RELEASE_INIT " /INCREMENTAL:NO")
endforeach()
string(APPEND CMAKE_STATIC_LINKER_FLAGS_INIT " ${_MACHINE_ARCH_FLAG}")
diff --git a/Modules/Platform/Windows-OpenWatcom.cmake b/Modules/Platform/Windows-OpenWatcom.cmake
index 269f923..7419fe4 100644
--- a/Modules/Platform/Windows-OpenWatcom.cmake
+++ b/Modules/Platform/Windows-OpenWatcom.cmake
@@ -32,14 +32,14 @@ else()
set(CMAKE_LIB_QUIET "-q")
endif()
-set(CMAKE_EXE_LINKER_FLAGS_INIT)
+string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ")
set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
set(CMAKE_CREATE_CONSOLE_EXE "system nt" )
-set(CMAKE_SHARED_LINKER_FLAGS_INIT "system nt_dll")
-set(CMAKE_MODULE_LINKER_FLAGS_INIT "system nt_dll")
+string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " system nt_dll")
+string(APPEND CMAKE_MODULE_LINKER_FLAGS_INIT " system nt_dll")
foreach(type SHARED MODULE EXE)
- set(CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT "debug all opt map")
- set(CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all opt map")
+ string(APPEND CMAKE_${type}_LINKER_FLAGS_DEBUG_INIT " debug all opt map")
+ string(APPEND CMAKE_${type}_LINKER_FLAGS_RELWITHDEBINFO_INIT " debug all opt map")
endforeach()
set(CMAKE_C_COMPILE_OPTIONS_DLL "-bd") # Note: This variable is a ';' separated list