[cmake-commits] king committed cmLocalGenerator.cxx 1.262 1.263
cmLocalGenerator.h 1.101 1.102
cmMakefileExecutableTargetGenerator.cxx 1.40 1.41
cmMakefileLibraryTargetGenerator.cxx 1.52 1.53
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Jan 29 21:16:51 EST 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv15073/Source
Modified Files:
cmLocalGenerator.cxx cmLocalGenerator.h
cmMakefileExecutableTargetGenerator.cxx
cmMakefileLibraryTargetGenerator.cxx
Log Message:
ENH: Enable use of link script whenever incremental archive construction rules are available. Enable use of archive construction rules on MSYS.
Index: cmMakefileLibraryTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileLibraryTargetGenerator.cxx,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- cmMakefileLibraryTargetGenerator.cxx 30 Jan 2008 01:46:25 -0000 1.52
+++ cmMakefileLibraryTargetGenerator.cxx 30 Jan 2008 02:16:49 -0000 1.53
@@ -673,7 +673,7 @@
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 @@
{
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 @@
}
}
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
Index: cmLocalGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.h,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- cmLocalGenerator.h 29 Jan 2008 20:07:33 -0000 1.101
+++ cmLocalGenerator.h 30 Jan 2008 02:16:49 -0000 1.102
@@ -210,6 +210,9 @@
const char* Defines;
};
+ /** Set whether to treat conversions to SHELL as a link script shell. */
+ void SetLinkScriptShell(bool b) { this->LinkScriptShell = b; }
+
/** Escape the given string to be used as a command line argument in
the native build system shell. Optionally allow the build
system to replace make variable references. Optionally adjust
@@ -346,6 +349,7 @@
bool NMake;
bool ForceUnixPath;
bool MSYSShell;
+ bool LinkScriptShell;
bool UseRelativePaths;
bool IgnoreLibPrefix;
bool Configured;
Index: cmMakefileExecutableTargetGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmMakefileExecutableTargetGenerator.cxx,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cmMakefileExecutableTargetGenerator.cxx 28 Jan 2008 13:38:36 -0000 1.40
+++ cmMakefileExecutableTargetGenerator.cxx 30 Jan 2008 02:16:49 -0000 1.41
@@ -367,6 +367,9 @@
// Expand the rule variables.
{
+ // 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);
@@ -428,6 +431,9 @@
this->LocalGenerator->ExpandRuleVariables(*i, vars);
}
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
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.262
retrieving revision 1.263
diff -u -d -r1.262 -r1.263
--- cmLocalGenerator.cxx 29 Jan 2008 20:07:33 -0000 1.262
+++ cmLocalGenerator.cxx 30 Jan 2008 02:16:49 -0000 1.263
@@ -50,6 +50,7 @@
this->MinGWMake = false;
this->NMake = false;
this->MSYSShell = false;
+ this->LinkScriptShell = false;
this->IgnoreLibPrefix = false;
this->UseRelativePaths = false;
this->Configured = false;
@@ -1995,7 +1996,7 @@
// For the MSYS shell convert drive letters to posix paths, so
// that c:/some/path becomes /c/some/path. This is needed to
// avoid problems with the shell path translation.
- if(this->MSYSShell)
+ if(this->MSYSShell && !this->LinkScriptShell)
{
if(result.size() > 2 && result[1] == ':')
{
More information about the Cmake-commits
mailing list