summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-04-18 12:51:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-04-18 12:51:54 (GMT)
commita3636dde5777fac3dd8975257cbb8d07cbad6b15 (patch)
treeeb5a49d71e2b27153eb2c3f28831e47c9212ec19 /Source/cmGeneratorTarget.cxx
parentc6a41a13bc025a30252ff569532fd2ca5768b8e9 (diff)
parent5e616fcf9ac1675fa4f3e7c1dc7f0e3dfb014df3 (diff)
downloadCMake-a3636dde5777fac3dd8975257cbb8d07cbad6b15.zip
CMake-a3636dde5777fac3dd8975257cbb8d07cbad6b15.tar.gz
CMake-a3636dde5777fac3dd8975257cbb8d07cbad6b15.tar.bz2
Merge topic 'fix-CMP0026-old'
5e616fcf CMP0026: Fix OLD behavior with file written during configure step Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !710
Diffstat (limited to 'Source/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 35b2603..32e2b00 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -941,6 +941,26 @@ void cmGeneratorTarget::GetSourceFiles(std::vector<std::string>& files,
void cmGeneratorTarget::GetSourceFiles(std::vector<cmSourceFile*>& files,
const std::string& config) const
{
+ if (!this->GlobalGenerator->GetConfigureDoneCMP0026()) {
+ // Since we are still configuring not all sources may exist yet,
+ // so we need to avoid full source classification because that
+ // requires the absolute paths to all sources to be determined.
+ // Since this is only for compatibility with old policies that
+ // projects should not depend on anymore, just compute the files
+ // without memoizing them.
+ std::vector<std::string> srcs;
+ this->GetSourceFiles(srcs, config);
+ std::set<cmSourceFile*> emitted;
+ for (std::vector<std::string>::const_iterator i = srcs.begin();
+ i != srcs.end(); ++i) {
+ cmSourceFile* sf = this->Makefile->GetOrCreateSource(*i);
+ if (emitted.insert(sf).second) {
+ files.push_back(sf);
+ }
+ }
+ return;
+ }
+
KindedSources const& kinded = this->GetKindedSources(config);
files.reserve(kinded.Sources.size());
for (std::vector<SourceAndKind>::const_iterator si = kinded.Sources.begin();