Merge topic 'fix-max-path-initialization'
8bfff686 cmLocalGenerator: Compute object max path on construction. 2c2479fb cmGlobalGenerator: Create all local generators after Configure(). 194bb068 cmGlobalGenerator: Remove unused method. c5f07e05 cmGlobalGenerator: Create local generators after all makefiles configured. dd408de4 cmGlobalGenerator: Create local generator after configuring the makefile. 8a88089b cmMakefile: Create the local generator after configuring the makefile. 934aa454 Makefiles: Remove need to create local generator at configure time. 61b48e70 Makefiles: Port to cmOutputConverter.
This commit is contained in:
commit
ede54544f1
@ -1091,6 +1091,18 @@ void cmGlobalGenerator::ClearEnabledLanguages()
|
|||||||
return this->CMakeInstance->GetState()->ClearEnabledLanguages();
|
return this->CMakeInstance->GetState()->ClearEnabledLanguages();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cmGlobalGenerator::CreateLocalGenerators()
|
||||||
|
{
|
||||||
|
cmDeleteAll(this->LocalGenerators);
|
||||||
|
this->LocalGenerators.clear();
|
||||||
|
this->LocalGenerators.reserve(this->Makefiles.size());
|
||||||
|
for (std::vector<cmMakefile*>::const_iterator it = this->Makefiles.begin();
|
||||||
|
it != this->Makefiles.end(); ++it)
|
||||||
|
{
|
||||||
|
this->LocalGenerators.push_back(this->CreateLocalGenerator(*it));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cmGlobalGenerator::Configure()
|
void cmGlobalGenerator::Configure()
|
||||||
{
|
{
|
||||||
this->FirstTimeProgress = 0.0f;
|
this->FirstTimeProgress = 0.0f;
|
||||||
@ -1099,8 +1111,6 @@ void cmGlobalGenerator::Configure()
|
|||||||
cmMakefile* dirMf =
|
cmMakefile* dirMf =
|
||||||
new cmMakefile(this, this->GetCMakeInstance()->GetCurrentSnapshot());
|
new cmMakefile(this, this->GetCMakeInstance()->GetCurrentSnapshot());
|
||||||
this->Makefiles.push_back(dirMf);
|
this->Makefiles.push_back(dirMf);
|
||||||
cmLocalGenerator *lg = this->CreateLocalGenerator(dirMf);
|
|
||||||
this->LocalGenerators.push_back(lg);
|
|
||||||
|
|
||||||
// set the Start directories
|
// set the Start directories
|
||||||
dirMf->SetCurrentSourceDirectory
|
dirMf->SetCurrentSourceDirectory
|
||||||
@ -1175,6 +1185,7 @@ void cmGlobalGenerator::Configure()
|
|||||||
|
|
||||||
void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
|
void cmGlobalGenerator::CreateGenerationObjects(TargetTypes targetTypes)
|
||||||
{
|
{
|
||||||
|
this->CreateLocalGenerators();
|
||||||
cmDeleteAll(this->GeneratorTargets);
|
cmDeleteAll(this->GeneratorTargets);
|
||||||
this->GeneratorTargets.clear();
|
this->GeneratorTargets.clear();
|
||||||
this->CreateGeneratorTargets(targetTypes);
|
this->CreateGeneratorTargets(targetTypes);
|
||||||
@ -1246,11 +1257,6 @@ bool cmGlobalGenerator::Compute()
|
|||||||
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
|
||||||
{
|
|
||||||
this->LocalGenerators[i]->ComputeObjectMaxPath();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add generator specific helper commands
|
// Add generator specific helper commands
|
||||||
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
for (i = 0; i < this->LocalGenerators.size(); ++i)
|
||||||
{
|
{
|
||||||
@ -1936,12 +1942,6 @@ void cmGlobalGenerator::AddMakefile(cmMakefile *mf)
|
|||||||
this->CMakeInstance->UpdateProgress("Configuring", prog);
|
this->CMakeInstance->UpdateProgress("Configuring", prog);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
|
||||||
void cmGlobalGenerator::AddLocalGenerator(cmLocalGenerator *lg)
|
|
||||||
{
|
|
||||||
this->LocalGenerators.push_back(lg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void cmGlobalGenerator::AddInstallComponent(const char* component)
|
void cmGlobalGenerator::AddInstallComponent(const char* component)
|
||||||
{
|
{
|
||||||
if(component && *component)
|
if(component && *component)
|
||||||
|
@ -186,7 +186,6 @@ public:
|
|||||||
{this->CurrentMakefile = mf;}
|
{this->CurrentMakefile = mf;}
|
||||||
|
|
||||||
void AddMakefile(cmMakefile *mf);
|
void AddMakefile(cmMakefile *mf);
|
||||||
void AddLocalGenerator(cmLocalGenerator *lg);
|
|
||||||
|
|
||||||
///! Set an generator for an "external makefile based project"
|
///! Set an generator for an "external makefile based project"
|
||||||
void SetExternalMakefileProjectGenerator(
|
void SetExternalMakefileProjectGenerator(
|
||||||
@ -466,6 +465,8 @@ private:
|
|||||||
|
|
||||||
virtual void ForceLinkerLanguages();
|
virtual void ForceLinkerLanguages();
|
||||||
|
|
||||||
|
void CreateLocalGenerators();
|
||||||
|
|
||||||
void CheckCompilerIdCompatibility(cmMakefile* mf,
|
void CheckCompilerIdCompatibility(cmMakefile* mf,
|
||||||
std::string const& lang) const;
|
std::string const& lang) const;
|
||||||
|
|
||||||
|
@ -578,23 +578,18 @@ void cmGlobalUnixMakefileGenerator3
|
|||||||
if (!targetName.empty())
|
if (!targetName.empty())
|
||||||
{
|
{
|
||||||
cmMakefile* mf;
|
cmMakefile* mf;
|
||||||
cmLocalUnixMakefileGenerator3 *lg;
|
if (!this->Makefiles.empty())
|
||||||
if (!this->LocalGenerators.empty())
|
|
||||||
{
|
{
|
||||||
lg = static_cast<cmLocalUnixMakefileGenerator3 *>
|
mf = this->Makefiles[0];
|
||||||
(this->LocalGenerators[0]);
|
|
||||||
mf = lg->GetMakefile();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
|
cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
|
||||||
mf = new cmMakefile(this, snapshot);
|
mf = new cmMakefile(this, snapshot);
|
||||||
lg = static_cast<cmLocalUnixMakefileGenerator3 *>
|
|
||||||
(this->CreateLocalGenerator(mf));
|
|
||||||
// set the Start directories
|
// set the Start directories
|
||||||
lg->GetMakefile()->SetCurrentSourceDirectory
|
mf->SetCurrentSourceDirectory
|
||||||
(this->CMakeInstance->GetHomeDirectory());
|
(this->CMakeInstance->GetHomeDirectory());
|
||||||
lg->GetMakefile()->SetCurrentBinaryDirectory
|
mf->SetCurrentBinaryDirectory
|
||||||
(this->CMakeInstance->GetHomeOutputDirectory());
|
(this->CMakeInstance->GetHomeOutputDirectory());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,12 +598,12 @@ void cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
tname += "/fast";
|
tname += "/fast";
|
||||||
}
|
}
|
||||||
tname = lg->Convert(tname,cmLocalGenerator::HOME_OUTPUT);
|
cmOutputConverter conv(mf->GetStateSnapshot());
|
||||||
|
tname = conv.Convert(tname,cmOutputConverter::HOME_OUTPUT);
|
||||||
cmSystemTools::ConvertToOutputSlashes(tname);
|
cmSystemTools::ConvertToOutputSlashes(tname);
|
||||||
makeCommand.push_back(tname);
|
makeCommand.push_back(tname);
|
||||||
if (this->LocalGenerators.empty())
|
if (this->Makefiles.empty())
|
||||||
{
|
{
|
||||||
delete lg;
|
|
||||||
delete mf;
|
delete mf;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,8 @@ cmLocalGenerator::cmLocalGenerator(cmGlobalGenerator* gg,
|
|||||||
this->EmitUniversalBinaryFlags = true;
|
this->EmitUniversalBinaryFlags = true;
|
||||||
this->BackwardsCompatibility = 0;
|
this->BackwardsCompatibility = 0;
|
||||||
this->BackwardsCompatibilityFinal = false;
|
this->BackwardsCompatibilityFinal = false;
|
||||||
|
|
||||||
|
this->ComputeObjectMaxPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
cmLocalGenerator::~cmLocalGenerator()
|
cmLocalGenerator::~cmLocalGenerator()
|
||||||
|
@ -300,7 +300,6 @@ public:
|
|||||||
void CreateEvaluationFileOutputs(const std::string& config);
|
void CreateEvaluationFileOutputs(const std::string& config);
|
||||||
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
|
void ProcessEvaluationFiles(std::vector<std::string>& generatedFiles);
|
||||||
|
|
||||||
void ComputeObjectMaxPath();
|
|
||||||
protected:
|
protected:
|
||||||
///! put all the libraries for a target on into the given stream
|
///! put all the libraries for a target on into the given stream
|
||||||
void OutputLinkLibraries(std::string& linkLibraries,
|
void OutputLinkLibraries(std::string& linkLibraries,
|
||||||
@ -360,6 +359,8 @@ private:
|
|||||||
bool GetShouldUseOldFlags(bool shared, const std::string &lang) const;
|
bool GetShouldUseOldFlags(bool shared, const std::string &lang) const;
|
||||||
void AddPositionIndependentFlags(std::string& flags, std::string const& l,
|
void AddPositionIndependentFlags(std::string& flags, std::string const& l,
|
||||||
int targetType);
|
int targetType);
|
||||||
|
|
||||||
|
void ComputeObjectMaxPath();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1756,11 +1756,6 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
|
|||||||
cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
|
cmMakefile* subMf = new cmMakefile(this->GlobalGenerator, newSnapshot);
|
||||||
this->GetGlobalGenerator()->AddMakefile(subMf);
|
this->GetGlobalGenerator()->AddMakefile(subMf);
|
||||||
|
|
||||||
// create a new local generator and set its parent
|
|
||||||
cmLocalGenerator *lg2 = this->GetGlobalGenerator()
|
|
||||||
->CreateLocalGenerator(subMf);
|
|
||||||
this->GetGlobalGenerator()->AddLocalGenerator(lg2);
|
|
||||||
|
|
||||||
// set the subdirs start dirs
|
// set the subdirs start dirs
|
||||||
subMf->SetCurrentSourceDirectory(srcPath);
|
subMf->SetCurrentSourceDirectory(srcPath);
|
||||||
subMf->SetCurrentBinaryDirectory(binPath);
|
subMf->SetCurrentBinaryDirectory(binPath);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user