summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefileLibraryTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-01-30 02:16:49 (GMT)
committerBrad King <brad.king@kitware.com>2008-01-30 02:16:49 (GMT)
commit52b3f85642bd54362ec84c7279e3d63047861a53 (patch)
tree4df72032fa11b810afe9cd879017c34a1f1308fc /Source/cmMakefileLibraryTargetGenerator.cxx
parent66e0b4212fbbaaf3c5aa5af6a51aa3a5af002edf (diff)
downloadCMake-52b3f85642bd54362ec84c7279e3d63047861a53.zip
CMake-52b3f85642bd54362ec84c7279e3d63047861a53.tar.gz
CMake-52b3f85642bd54362ec84c7279e3d63047861a53.tar.bz2
ENH: Enable use of link script whenever incremental archive construction rules are available. Enable use of archive construction rules on MSYS.
Diffstat (limited to 'Source/cmMakefileLibraryTargetGenerator.cxx')
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index a81cfd6..8e96fd6 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -673,7 +673,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::vector<std::string> archiveAppendCommands;
std::vector<std::string> archiveFinishCommands;
std::string::size_type archiveCommandLimit = std::string::npos;
- if(useLinkScript && this->Target->GetType() == cmTarget::STATIC_LIBRARY)
+ if(this->Target->GetType() == cmTarget::STATIC_LIBRARY)
{
std::string arCreateVar = "CMAKE_";
arCreateVar += linkLanguage;
@@ -696,18 +696,28 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
{
cmSystemTools::ExpandListArgument(rule, archiveFinishCommands);
}
+ }
+
+ // Decide whether to use archiving rules.
+ bool useArchiveRules =
+ !archiveCreateCommands.empty() && !archiveAppendCommands.empty();
+ if(useArchiveRules)
+ {
+ // Archiving rules are always run with a link script.
+ useLinkScript = true;
// Limit the length of individual object lists to less than the
// 32K command line length limit on Windows. We could make this a
// platform file variable but this should work everywhere.
archiveCommandLimit = 30000;
}
- bool useArchiveRules =
- !archiveCreateCommands.empty() && !archiveAppendCommands.empty();
// Expand the rule variables.
std::vector<std::string> real_link_commands;
{
+ // Set path conversion for link script shells.
+ this->LocalGenerator->SetLinkScriptShell(useLinkScript);
+
// Collect up flags to link in needed libraries.
cmOStringStream linklibs;
this->LocalGenerator->OutputLinkLibraries(linklibs, *this->Target, relink);
@@ -864,6 +874,9 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
}
this->LocalGenerator->TargetImplib = "";
+
+ // Restore path conversion to normal shells.
+ this->LocalGenerator->SetLinkScriptShell(false);
}
// Optionally convert the build rule to use a script to avoid long