summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-07-18 15:11:37 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-07-18 15:12:00 (GMT)
commit787017451c437713b05a2ffc6fe609ea7da5f95b (patch)
treee924e59950dcaacd3a942f27c85cddf77ef56822 /Source/cmGeneratorTarget.cxx
parentec049641c46eb788b25713e5d96ff32c89f0e819 (diff)
parentd89e10cd58e5f9e21cbd466e56a1890e2811bee0 (diff)
downloadCMake-787017451c437713b05a2ffc6fe609ea7da5f95b.zip
CMake-787017451c437713b05a2ffc6fe609ea7da5f95b.tar.gz
CMake-787017451c437713b05a2ffc6fe609ea7da5f95b.tar.bz2
Merge topic 'objlib-own-target-objs'
d89e10cd Diagnose object library self-reference Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1053
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 1802da4..329c7a9 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1025,12 +1025,23 @@ cmGeneratorTarget::KindedSources const& cmGeneratorTarget::GetKindedSources(
std::string const key = cmSystemTools::UpperCase(config);
KindedSourcesMapType::iterator it = this->KindedSourcesMap.find(key);
if (it != this->KindedSourcesMap.end()) {
+ if (!it->second.Initialized) {
+ std::ostringstream e;
+ e << "The SOURCES of \"" << this->GetName()
+ << "\" use a generator expression that depends on the "
+ "SOURCES themselves.";
+ this->GlobalGenerator->GetCMakeInstance()->IssueMessage(
+ cmake::FATAL_ERROR, e.str(), this->GetBacktrace());
+ static KindedSources empty;
+ return empty;
+ }
return it->second;
}
// Add an entry to the map for this configuration.
KindedSources& files = this->KindedSourcesMap[key];
this->ComputeKindedSources(files, config);
+ files.Initialized = true;
return files;
}