summaryrefslogtreecommitdiffstats
path: root/Source/cmExportTryCompileFileGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-03-13 17:42:38 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-03-13 17:42:45 (GMT)
commitbdbee54a8317806b4a93aec9f8eee1b876da9a32 (patch)
tree94140855754fd9e6ee81b9d71995606eeae8599a /Source/cmExportTryCompileFileGenerator.cxx
parent7c557e2227f446d1c265ac7b5aa8055e3f4ea713 (diff)
parent1b5e52fd651ab17b3f9efb8f3e2e069550bf7a66 (diff)
downloadCMake-bdbee54a8317806b4a93aec9f8eee1b876da9a32.zip
CMake-bdbee54a8317806b4a93aec9f8eee1b876da9a32.tar.gz
CMake-bdbee54a8317806b4a93aec9f8eee1b876da9a32.tar.bz2
Merge topic 'genex-COMPILE_LANGUAGE-system-include'
1b5e52fd65 Genex: Fix COMPILE_LANGUAGE propagation through try_compile 2deb9b7f34 Genex: Fix COMPILE_LANGUAGE in SYSTEM include directories Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1844
Diffstat (limited to 'Source/cmExportTryCompileFileGenerator.cxx')
-rw-r--r--Source/cmExportTryCompileFileGenerator.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 798f2e6..87648cb 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -18,7 +18,8 @@
cmExportTryCompileFileGenerator::cmExportTryCompileFileGenerator(
cmGlobalGenerator* gg, const std::vector<std::string>& targets,
- cmMakefile* mf)
+ cmMakefile* mf, std::set<std::string> const& langs)
+ : Languages(langs.begin(), langs.end())
{
gg->CreateImportedGenerationObjects(mf, targets, this->Exports);
}
@@ -36,12 +37,14 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
ImportPropertyMap properties;
+ for (std::string const& lang : this->Languages) {
#define FIND_TARGETS(PROPERTY) \
- this->FindTargets("INTERFACE_" #PROPERTY, te, emittedDeps);
+ this->FindTargets("INTERFACE_" #PROPERTY, te, lang, emittedDeps);
- CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
+ CM_FOR_EACH_TRANSITIVE_PROPERTY_NAME(FIND_TARGETS)
#undef FIND_TARGETS
+ }
this->PopulateProperties(te, properties, emittedDeps);
@@ -53,7 +56,7 @@ bool cmExportTryCompileFileGenerator::GenerateMainFile(std::ostream& os)
std::string cmExportTryCompileFileGenerator::FindTargets(
const std::string& propName, cmGeneratorTarget const* tgt,
- std::set<cmGeneratorTarget const*>& emitted)
+ std::string const& language, std::set<cmGeneratorTarget const*>& emitted)
{
const char* prop = tgt->GetProperty(propName);
if (!prop) {
@@ -72,8 +75,9 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
cmGeneratorTarget gDummyHead(&dummyHead, tgt->GetLocalGenerator());
- std::string result = cge->Evaluate(tgt->GetLocalGenerator(), this->Config,
- false, &gDummyHead, tgt, &dagChecker);
+ std::string result =
+ cge->Evaluate(tgt->GetLocalGenerator(), this->Config, false, &gDummyHead,
+ tgt, &dagChecker, language);
const std::set<cmGeneratorTarget const*>& allTargets =
cge->GetAllTargetsSeen();
@@ -97,7 +101,8 @@ void cmExportTryCompileFileGenerator::PopulateProperties(
if (p.find("IMPORTED_LINK_INTERFACE_LIBRARIES") == 0 ||
p.find("IMPORTED_LINK_DEPENDENT_LIBRARIES") == 0 ||
p.find("INTERFACE_LINK_LIBRARIES") == 0) {
- std::string evalResult = this->FindTargets(p, target, emitted);
+ std::string evalResult =
+ this->FindTargets(p, target, std::string(), emitted);
std::vector<std::string> depends;
cmSystemTools::ExpandListArgument(evalResult, depends);