diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-10-17 12:27:59 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-10-18 14:29:29 (GMT) |
commit | 1293c1561a58b2f8b0bd4ec05bb249fc36f487ac (patch) | |
tree | c45a907930d492790b0ce677c5c9cc4cddabcb98 /Source/cmExportTryCompileFileGenerator.cxx | |
parent | 381e7afd363d64c72b83e69fd6c6cad5fc3eefb4 (diff) | |
download | CMake-1293c1561a58b2f8b0bd4ec05bb249fc36f487ac.zip CMake-1293c1561a58b2f8b0bd4ec05bb249fc36f487ac.tar.gz CMake-1293c1561a58b2f8b0bd4ec05bb249fc36f487ac.tar.bz2 |
cmExportTryCompileFileGenerator: Port to cmGeneratorTarget.
Diffstat (limited to 'Source/cmExportTryCompileFileGenerator.cxx')
-rw-r--r-- | Source/cmExportTryCompileFileGenerator.cxx | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx index d0e65e1..0fafa86 100644 --- a/Source/cmExportTryCompileFileGenerator.cxx +++ b/Source/cmExportTryCompileFileGenerator.cxx @@ -14,13 +14,16 @@ #include "cmGeneratedFileStream.h" #include "cmGlobalGenerator.h" +#include "cmLocalGenerator.h" #include "cmGeneratorExpressionDAGChecker.h" //---------------------------------------------------------------------------- cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator( - cmGlobalGenerator* gg) + cmGlobalGenerator* gg, + const std::vector<std::string>& targets, + cmMakefile* mf) { - gg->CreateGenerationObjects(cmGlobalGenerator::ImportedOnly); + gg->CreateImportedGenerationObjects(mf, targets, this->Exports); } bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os) @@ -29,25 +32,25 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os) std::set<cmTarget const*> emittedDeps; while(!this->Exports.empty()) { - cmTarget const* te = this->Exports.back(); + cmGeneratorTarget const* te = this->Exports.back(); this->Exports.pop_back(); - if (emitted.insert(te).second) + if (emitted.insert(te->Target).second) { - emittedDeps.insert(te); - this->GenerateImportTargetCode(os, te); + emittedDeps.insert(te->Target); + this->GenerateImportTargetCode(os, te->Target); ImportPropertyMap properties; #define FIND_TARGETS(PROPERTY) \ - this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps); + this->FindTargets("INTERFACE_" #PROPERTY, te->Target, emittedDeps); CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS) #undef FIND_TARGETS - this->PopulateProperties(te, properties, emittedDeps); + this->PopulateProperties(te->Target, properties, emittedDeps); - this->GenerateInterfaceProperties(te, os, properties); + this->GenerateInterfaceProperties(te->Target, os, properties); } } return true; @@ -91,7 +94,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets( { if(emitted.insert((*li)->Target).second) { - this->Exports.push_back((*li)->Target); + this->Exports.push_back((*li)); } } return result; @@ -104,6 +107,8 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target, std::set<cmTarget const*> &emitted) { cmPropertyMap props = target->GetProperties(); + cmGeneratorTarget* gt = + target->GetMakefile()->GetGlobalGenerator()->GetGeneratorTarget(target); for(cmPropertyMap::const_iterator i = props.begin(); i != props.end(); ++i) { properties[i->first] = i->second.GetValue(); @@ -120,8 +125,9 @@ cmExportTryCompileFileGenerator::PopulateProperties(cmTarget const* target, for(std::vector<std::string>::const_iterator li = depends.begin(); li != depends.end(); ++li) { - cmTarget *tgt = target->GetMakefile()->FindTargetToUse(*li); - if(tgt && emitted.insert(tgt).second) + cmGeneratorTarget *tgt = + gt->GetLocalGenerator()->FindGeneratorTargetToUse(*li); + if(tgt && emitted.insert(tgt->Target).second) { this->Exports.push_back(tgt); } |