diff options
author | Brad King <brad.king@kitware.com> | 2008-02-27 22:10:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-02-27 22:10:45 (GMT) |
commit | dfe2ea6406d3ab22f1a4193906611fb67fd3ab6e (patch) | |
tree | e00166515d5fe978ef5fe0dd15852790145951e0 /Source/cmMakefileExecutableTargetGenerator.cxx | |
parent | 4c137bad6b663ff342064c293a49fecf03498207 (diff) | |
download | CMake-dfe2ea6406d3ab22f1a4193906611fb67fd3ab6e.zip CMake-dfe2ea6406d3ab22f1a4193906611fb67fd3ab6e.tar.gz CMake-dfe2ea6406d3ab22f1a4193906611fb67fd3ab6e.tar.bz2 |
ENH: Handle large object file lists on some platforms
- Use a response file when enabled by
CMAKE_<LANG>_USE_RESPONSE_FILE_FOR_OBJECTS
- Enable for C and CXX with cl (MSVC)
- Enable for Fortran with ifort (Intel Fortran)
Diffstat (limited to 'Source/cmMakefileExecutableTargetGenerator.cxx')
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 9e8d42d..1715fe9 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -328,6 +328,18 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } } + // Select whether to use a response file for objects. + bool useResponseFile = false; + { + std::string responseVar = "CMAKE_"; + responseVar += linkLanguage; + responseVar += "_USE_RESPONSE_FILE_FOR_OBJECTS"; + if(this->Makefile->IsOn(responseVar.c_str())) + { + useResponseFile = true; + } + } + // Expand the rule variables. { // Set path conversion for link script shells. @@ -343,7 +355,18 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) std::string variableNameExternal; this->WriteObjectsVariable(variableName, variableNameExternal); std::string buildObjs; - if(useLinkScript) + if(useResponseFile) + { + std::string objects; + this->WriteObjectsString(objects); + std::string objects_rsp = + this->CreateResponseFile("objects.rsp", objects, depends); + buildObjs = "@"; + buildObjs += this->Convert(objects_rsp.c_str(), + cmLocalGenerator::NONE, + cmLocalGenerator::SHELL); + } + else if(useLinkScript) { this->WriteObjectsString(buildObjs); } |