mirror of
https://github.com/reactos/CMake.git
synced 2024-12-01 07:20:22 +00:00
Move the exported check for dependencies of targets
Check only once, in the Config.cmake file, instead of once in each Config-<cfg>.cmake file.
This commit is contained in:
parent
d8fe1fcd80
commit
cfd4f0a4f4
@ -74,16 +74,16 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
this->GenerateInterfaceProperties(te, os, properties);
|
this->GenerateInterfaceProperties(te, os, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
|
||||||
|
|
||||||
// Generate import file content for each configuration.
|
// Generate import file content for each configuration.
|
||||||
for(std::vector<std::string>::const_iterator
|
for(std::vector<std::string>::const_iterator
|
||||||
ci = this->Configurations.begin();
|
ci = this->Configurations.begin();
|
||||||
ci != this->Configurations.end(); ++ci)
|
ci != this->Configurations.end(); ++ci)
|
||||||
{
|
{
|
||||||
this->GenerateImportConfig(os, ci->c_str());
|
this->GenerateImportConfig(os, ci->c_str(), missingTargets);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,8 @@ bool cmExportBuildFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
void
|
void
|
||||||
cmExportBuildFileGenerator
|
cmExportBuildFileGenerator
|
||||||
::GenerateImportTargetsConfig(std::ostream& os,
|
::GenerateImportTargetsConfig(std::ostream& os,
|
||||||
const char* config, std::string const& suffix)
|
const char* config, std::string const& suffix,
|
||||||
|
std::vector<std::string> &missingTargets)
|
||||||
{
|
{
|
||||||
for(std::vector<cmTarget*>::const_iterator
|
for(std::vector<cmTarget*>::const_iterator
|
||||||
tei = this->Exports->begin();
|
tei = this->Exports->begin();
|
||||||
@ -104,7 +105,6 @@ cmExportBuildFileGenerator
|
|||||||
if(!properties.empty())
|
if(!properties.empty())
|
||||||
{
|
{
|
||||||
// Get the rest of the target details.
|
// Get the rest of the target details.
|
||||||
std::vector<std::string> missingTargets;
|
|
||||||
this->SetImportDetailProperties(config, suffix,
|
this->SetImportDetailProperties(config, suffix,
|
||||||
target, properties, missingTargets);
|
target, properties, missingTargets);
|
||||||
this->SetImportLinkInterface(config, suffix,
|
this->SetImportLinkInterface(config, suffix,
|
||||||
@ -119,7 +119,6 @@ cmExportBuildFileGenerator
|
|||||||
// properties);
|
// properties);
|
||||||
|
|
||||||
// Generate code in the export file.
|
// Generate code in the export file.
|
||||||
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
|
||||||
this->GenerateImportPropertyCode(os, config, target, properties);
|
this->GenerateImportPropertyCode(os, config, target, properties);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,8 @@ protected:
|
|||||||
virtual bool GenerateMainFile(std::ostream& os);
|
virtual bool GenerateMainFile(std::ostream& os);
|
||||||
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
||||||
const char* config,
|
const char* config,
|
||||||
std::string const& suffix);
|
std::string const& suffix,
|
||||||
|
std::vector<std::string> &missingTargets);
|
||||||
virtual void HandleMissingTarget(std::string& link_libs,
|
virtual void HandleMissingTarget(std::string& link_libs,
|
||||||
std::vector<std::string>& missingTargets,
|
std::vector<std::string>& missingTargets,
|
||||||
cmMakefile* mf,
|
cmMakefile* mf,
|
||||||
|
@ -107,7 +107,8 @@ bool cmExportFileGenerator::GenerateImportFile()
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
|
void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
|
||||||
const char* config)
|
const char* config,
|
||||||
|
std::vector<std::string> &missingTargets)
|
||||||
{
|
{
|
||||||
// Construct the property configuration suffix.
|
// Construct the property configuration suffix.
|
||||||
std::string suffix = "_";
|
std::string suffix = "_";
|
||||||
@ -121,7 +122,7 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate the per-config target information.
|
// Generate the per-config target information.
|
||||||
this->GenerateImportTargetsConfig(os, config, suffix);
|
this->GenerateImportTargetsConfig(os, config, suffix, missingTargets);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -47,7 +47,8 @@ protected:
|
|||||||
|
|
||||||
// Generate per-configuration target information to the given output
|
// Generate per-configuration target information to the given output
|
||||||
// stream.
|
// stream.
|
||||||
void GenerateImportConfig(std::ostream& os, const char* config);
|
void GenerateImportConfig(std::ostream& os, const char* config,
|
||||||
|
std::vector<std::string> &missingTargets);
|
||||||
|
|
||||||
// Methods to implement export file code generation.
|
// Methods to implement export file code generation.
|
||||||
void GenerateImportHeaderCode(std::ostream& os, const char* config = 0);
|
void GenerateImportHeaderCode(std::ostream& os, const char* config = 0);
|
||||||
@ -85,7 +86,8 @@ protected:
|
|||||||
/** Each subclass knows where the target files are located. */
|
/** Each subclass knows where the target files are located. */
|
||||||
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
||||||
const char* config,
|
const char* config,
|
||||||
std::string const& suffix) = 0;
|
std::string const& suffix,
|
||||||
|
std::vector<std::string> &missingTargets) = 0;
|
||||||
|
|
||||||
/** Each subclass knows how to deal with a target that is missing from an
|
/** Each subclass knows how to deal with a target that is missing from an
|
||||||
* export set. */
|
* export set. */
|
||||||
|
@ -93,7 +93,6 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
this->GenerateInterfaceProperties(te, os, properties);
|
this->GenerateInterfaceProperties(te, os, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
|
||||||
|
|
||||||
// Now load per-configuration properties for them.
|
// Now load per-configuration properties for them.
|
||||||
os << "# Load information for each installed configuration.\n"
|
os << "# Load information for each installed configuration.\n"
|
||||||
@ -111,17 +110,21 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
|
|||||||
ci = this->Configurations.begin();
|
ci = this->Configurations.begin();
|
||||||
ci != this->Configurations.end(); ++ci)
|
ci != this->Configurations.end(); ++ci)
|
||||||
{
|
{
|
||||||
if(!this->GenerateImportFileConfig(ci->c_str()))
|
if(!this->GenerateImportFileConfig(ci->c_str(), missingTargets))
|
||||||
{
|
{
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config)
|
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config,
|
||||||
|
std::vector<std::string> &missingTargets)
|
||||||
{
|
{
|
||||||
// Skip configurations not enabled for this export.
|
// Skip configurations not enabled for this export.
|
||||||
if(!this->IEGen->InstallsForConfig(config))
|
if(!this->IEGen->InstallsForConfig(config))
|
||||||
@ -161,7 +164,7 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config)
|
|||||||
this->GenerateImportHeaderCode(os, config);
|
this->GenerateImportHeaderCode(os, config);
|
||||||
|
|
||||||
// Generate the per-config target information.
|
// Generate the per-config target information.
|
||||||
this->GenerateImportConfig(os, config);
|
this->GenerateImportConfig(os, config, missingTargets);
|
||||||
|
|
||||||
// End with the import file footer.
|
// End with the import file footer.
|
||||||
this->GenerateImportFooterCode(os);
|
this->GenerateImportFooterCode(os);
|
||||||
@ -176,7 +179,8 @@ cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config)
|
|||||||
void
|
void
|
||||||
cmExportInstallFileGenerator
|
cmExportInstallFileGenerator
|
||||||
::GenerateImportTargetsConfig(std::ostream& os,
|
::GenerateImportTargetsConfig(std::ostream& os,
|
||||||
const char* config, std::string const& suffix)
|
const char* config, std::string const& suffix,
|
||||||
|
std::vector<std::string> &missingTargets)
|
||||||
{
|
{
|
||||||
// Add code to compute the installation prefix relative to the
|
// Add code to compute the installation prefix relative to the
|
||||||
// import file location.
|
// import file location.
|
||||||
@ -225,7 +229,6 @@ cmExportInstallFileGenerator
|
|||||||
if(!properties.empty())
|
if(!properties.empty())
|
||||||
{
|
{
|
||||||
// Get the rest of the target details.
|
// Get the rest of the target details.
|
||||||
std::vector<std::string> missingTargets;
|
|
||||||
this->SetImportDetailProperties(config, suffix,
|
this->SetImportDetailProperties(config, suffix,
|
||||||
te->Target, properties, missingTargets);
|
te->Target, properties, missingTargets);
|
||||||
|
|
||||||
@ -240,7 +243,6 @@ cmExportInstallFileGenerator
|
|||||||
// properties);
|
// properties);
|
||||||
|
|
||||||
// Generate code in the export file.
|
// Generate code in the export file.
|
||||||
this->GenerateMissingTargetsCheckCode(os, missingTargets);
|
|
||||||
this->GenerateImportPropertyCode(os, config, te->Target, properties);
|
this->GenerateImportPropertyCode(os, config, te->Target, properties);
|
||||||
this->GenerateImportedFileChecksCode(os, te->Target, properties,
|
this->GenerateImportedFileChecksCode(os, te->Target, properties,
|
||||||
importedLocations);
|
importedLocations);
|
||||||
|
@ -56,7 +56,8 @@ protected:
|
|||||||
virtual bool GenerateMainFile(std::ostream& os);
|
virtual bool GenerateMainFile(std::ostream& os);
|
||||||
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
virtual void GenerateImportTargetsConfig(std::ostream& os,
|
||||||
const char* config,
|
const char* config,
|
||||||
std::string const& suffix);
|
std::string const& suffix,
|
||||||
|
std::vector<std::string> &missingTargets);
|
||||||
virtual void HandleMissingTarget(std::string& link_libs,
|
virtual void HandleMissingTarget(std::string& link_libs,
|
||||||
std::vector<std::string>& missingTargets,
|
std::vector<std::string>& missingTargets,
|
||||||
cmMakefile* mf,
|
cmMakefile* mf,
|
||||||
@ -72,7 +73,8 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
/** Generate a per-configuration file for the targets. */
|
/** Generate a per-configuration file for the targets. */
|
||||||
bool GenerateImportFileConfig(const char* config);
|
bool GenerateImportFileConfig(const char* config,
|
||||||
|
std::vector<std::string> &missingTargets);
|
||||||
|
|
||||||
/** Fill in properties indicating installed file locations. */
|
/** Fill in properties indicating installed file locations. */
|
||||||
void SetImportLocationProperty(const char* config,
|
void SetImportLocationProperty(const char* config,
|
||||||
|
Loading…
Reference in New Issue
Block a user