summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-08-10 18:33:01 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2010-08-10 18:33:01 (GMT)
commit4b432328a26b944a34b7e7e0dcfde98ec3c936ab (patch)
treedacf815b0d3cc6f542f8f7885f2848bdb0fbf1aa /Modules
parentfab51e6f8d07445bc05eca3cba5f4a0a396f6a14 (diff)
parentb03f4ec09d5d680f63b88aa93b80a741c1dd12ab (diff)
downloadCMake-4b432328a26b944a34b7e7e0dcfde98ec3c936ab.zip
CMake-4b432328a26b944a34b7e7e0dcfde98ec3c936ab.tar.gz
CMake-4b432328a26b944a34b7e7e0dcfde98ec3c936ab.tar.bz2
Merge topic 'mingw-response-files'
b03f4ec No response files with GNU ld <= 2.16 (#10913)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-GNU.cmake9
1 files changed, 8 insertions, 1 deletions
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index af03841..8299d70 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -49,6 +49,13 @@ set(CMAKE_CREATE_WIN32_EXE "-mwindows")
set(CMAKE_GNULD_IMAGE_VERSION
"-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
+# Check if GNU ld is too old to support @FILE syntax.
+set(__WINDOWS_GNU_LD_RESPONSE 1)
+execute_process(COMMAND ld -v OUTPUT_VARIABLE _help ERROR_VARIABLE _help)
+if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]")
+ set(__WINDOWS_GNU_LD_RESPONSE 0)
+endif()
+
macro(__windows_compiler_gnu lang)
if(MSYS OR MINGW)
@@ -68,7 +75,7 @@ macro(__windows_compiler_gnu lang)
endif()
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
- set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
# Binary link rules.