summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileExecutableTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-02-27 22:10:45 (GMT)
committerBrad King <brad.king@kitware.com>2008-02-27 22:10:45 (GMT)
commitdfe2ea6406d3ab22f1a4193906611fb67fd3ab6e (patch)
treee00166515d5fe978ef5fe0dd15852790145951e0 /Source/cmMakefileExecutableTargetGenerator.cxx
parent4c137bad6b663ff342064c293a49fecf03498207 (diff)
downloadCMake-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.cxx25
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);
}