diff options
author | Brad King <brad.king@kitware.com> | 2014-03-04 18:25:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-03-05 18:07:41 (GMT) |
commit | 489b1c23b9a880da0012427b60cce7b6f5ddaa27 (patch) | |
tree | b2688130d3a3af8bd6bd9e3d230510508069afde /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 745caae6dddc9ab5c38a669adf3906f6e3484c80 (diff) | |
download | CMake-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/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 6754525..1802054 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -318,6 +318,18 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } } + // 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; + } + } + // Expand the rule variables. { // Set path conversion for link script shells. @@ -325,7 +337,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) // Collect up flags to link in needed libraries. std::string linkLibs; - this->CreateLinkLibs(linkLibs, relink, depends); + this->CreateLinkLibs(linkLibs, relink, useResponseFileForLibs, depends); // Construct object file lists that may be needed to expand the // rule. |