From 86cb17b18de78e178b76e9be471789084994a162 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 17 Mar 2011 15:44:57 -0400 Subject: [PATCH] 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. --- Modules/Platform/Windows-GNU.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 7084b83bae..271236cd52 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 "@")