summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-03-17 19:44:57 (GMT)
committerBrad King <brad.king@kitware.com>2011-03-17 21:56:14 (GMT)
commit86cb17b18de78e178b76e9be471789084994a162 (patch)
treea8eb9c2c9211093e3eabf7c47b772d769072c547 /Modules/Platform
parent9a0b9bc8b756bcb027485d72fb9619c8e10f5a0a (diff)
downloadCMake-86cb17b18de78e178b76e9be471789084994a162.zip
CMake-86cb17b18de78e178b76e9be471789084994a162.tar.gz
CMake-86cb17b18de78e178b76e9be471789084994a162.tar.bz2
Pass include directories with response files to GNU on Windows
The GNU 4.x toolchain on MinGW (and therefore MSYS) allows compiler options to be passed via response files. Use this to pass include directory -I options. This allows the include file search path to be very long despite shell and mingw32-make command line length limits.
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Windows-GNU.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake
index 7084b83..271236c 100644
--- a/Modules/Platform/Windows-GNU.cmake
+++ b/Modules/Platform/Windows-GNU.cmake
@@ -78,6 +78,7 @@ macro(__windows_compiler_gnu lang)
set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE})
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 1)
# We prefer "@" for response files but it is not supported by gcc 3.
execute_process(COMMAND ${CMAKE_${lang}_COMPILER} --version OUTPUT_VARIABLE _ver ERROR_VARIABLE _ver)
@@ -91,6 +92,8 @@ macro(__windows_compiler_gnu lang)
# Use "-Wl,@" to pass the response file to the linker.
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@")
endif()
+ # The GNU 3.x compilers do not support response files (only linkers).
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_INCLUDES 0)
elseif(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS)
# Use "@" to pass the response file to the front-end.
set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@")