summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-04 18:25:42 (GMT)
committerBrad King <brad.king@kitware.com>2014-03-05 18:07:41 (GMT)
commit489b1c23b9a880da0012427b60cce7b6f5ddaa27 (patch)
treeb2688130d3a3af8bd6bd9e3d230510508069afde /Source/cmMakefileLibraryTargetGenerator.cxx
parent745caae6dddc9ab5c38a669adf3906f6e3484c80 (diff)
downloadCMake-489b1c23b9a880da0012427b60cce7b6f5ddaa27.zip
CMake-489b1c23b9a880da0012427b60cce7b6f5ddaa27.tar.gz
CMake-489b1c23b9a880da0012427b60cce7b6f5ddaa27.tar.bz2
Windows: Use response files to specify link libraries for GNU tools
Work around the command-line-length limit by using an @linklibs.rsp response file to pass the flags for link libraries. This allows very long lists of libraries to be used in addition to the existing support for passing object files via response file. Suggested-by: Peter Keuschnigg <peter.keuschnigg@pmu.ac.at>
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index c639f3e..39e00b2 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -485,6 +485,18 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
}
+ // Select whether to use a response file for libraries.
+ bool useResponseFileForLibs = false;
+ {
+ std::string responseVar = "CMAKE_";
+ responseVar += linkLanguage;
+ responseVar += "_USE_RESPONSE_FILE_FOR_LIBRARIES";
+ if(this->Makefile->IsOn(responseVar.c_str()))
+ {
+ useResponseFileForLibs = true;
+ }
+ }
+
// For static libraries there might be archiving rules.
bool haveStaticLibraryRule = false;
std::vector<std::string> archiveCreateCommands;
@@ -546,7 +558,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string linkLibs;
if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
{
- this->CreateLinkLibs(linkLibs, relink, depends);
+ this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends);
}
// Construct object file lists that may be needed to expand the