diff options
author | Brad King <brad.king@kitware.com> | 2014-12-01 18:43:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-12-01 18:49:26 (GMT) |
commit | 1c5be1f367abcc97ed4fe4f0a0235c147e6868a4 (patch) | |
tree | a4869ae1b8f81286a5a69d99ba69a708aa9b781d /Source | |
parent | 433c6d4689ca86f1a8d8d966be0204e98f95b968 (diff) | |
download | CMake-1c5be1f367abcc97ed4fe4f0a0235c147e6868a4.zip CMake-1c5be1f367abcc97ed4fe4f0a0235c147e6868a4.tar.gz CMake-1c5be1f367abcc97ed4fe4f0a0235c147e6868a4.tar.bz2 |
Makefile: Do not create an empty linker response file
Since commit v3.1.0-rc1~821^2 (Windows: Use response files to specify
link libraries for GNU tools, 2014-03-04) we use a response file to pass
possibly long linker flag lists to the GNU linker on Windows. On MinGW,
this may cause gfortran to use a response file to pass some flags to its
own internal invocation. This is okay except when we are parsing
implicit link flags from the compiler ABI detection build. If gfortran
uses a response file in that case then we may miss extracting some of
the implicit link flags, such as -lgfortran. Fortunately, in the
compiler ABI detection case we do not actually link to anything so the
response file is empty. Work around this problem by simply not using a
response file when the list of flags it is used to pass is empty (or
just whitespace).
Reported-by: Bill Somerville <bill@classdesign.com>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 1f8f686..85e371d 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1846,7 +1846,7 @@ cmMakefileTargetGenerator useWatcomQuote); linkLibs = frameworkPath + linkPath + linkLibs; - if(useResponseFile) + if(useResponseFile && linkLibs.find_first_not_of(" ") != linkLibs.npos) { // Lookup the response file reference flag. std::string responseFlagVar = "CMAKE_"; |