summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-03 19:38:25 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-08 18:52:22 (GMT)
commit8bb5c96bf8bc363afa5da09ce1979614565d31ba (patch)
tree6eb38a64f7c482e9936b3e4af548ee2d9a523af8 /Source
parentaea465793e9744fcda0c26dad14c0620b7448f14 (diff)
downloadCMake-8bb5c96bf8bc363afa5da09ce1979614565d31ba.zip
CMake-8bb5c96bf8bc363afa5da09ce1979614565d31ba.tar.gz
CMake-8bb5c96bf8bc363afa5da09ce1979614565d31ba.tar.bz2
cmLocalVisualStudio7Generator: Adopt SourcesVisited lookup table
Move it up the hierarchy from `cmLocalVisualStudio10Generator`. Propagate contents from a target's dependencies as part of the main target iteration logic instead of as part of the generator-specific target generation.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalVisualStudio10Generator.cxx7
-rw-r--r--Source/cmLocalVisualStudio10Generator.h9
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx9
-rw-r--r--Source/cmLocalVisualStudio7Generator.h9
4 files changed, 18 insertions, 16 deletions
diff --git a/Source/cmLocalVisualStudio10Generator.cxx b/Source/cmLocalVisualStudio10Generator.cxx
index 98e9db9..3ed49a0 100644
--- a/Source/cmLocalVisualStudio10Generator.cxx
+++ b/Source/cmLocalVisualStudio10Generator.cxx
@@ -68,13 +68,6 @@ cmLocalVisualStudio10Generator::~cmLocalVisualStudio10Generator()
void cmLocalVisualStudio10Generator::GenerateTarget(cmGeneratorTarget* target)
{
- auto& targetVisited = this->GetSourcesVisited(target);
- auto& deps = this->GlobalGenerator->GetTargetDirectDepends(target);
- for (auto& d : deps) {
- // Take the union of visited source files of custom commands
- auto depVisited = this->GetSourcesVisited(d);
- targetVisited.insert(depVisited.begin(), depVisited.end());
- }
if (static_cast<cmGlobalVisualStudioGenerator*>(this->GlobalGenerator)
->TargetIsFortranOnly(target)) {
this->cmLocalVisualStudio7Generator::GenerateTarget(target);
diff --git a/Source/cmLocalVisualStudio10Generator.h b/Source/cmLocalVisualStudio10Generator.h
index 631132e..45ee082 100644
--- a/Source/cmLocalVisualStudio10Generator.h
+++ b/Source/cmLocalVisualStudio10Generator.h
@@ -28,19 +28,10 @@ public:
void ReadAndStoreExternalGUID(const std::string& name,
const char* path) override;
- std::set<cmSourceFile const*>& GetSourcesVisited(
- cmGeneratorTarget const* target)
- {
- return SourcesVisited[target];
- };
-
protected:
const char* ReportErrorLabel() const override;
bool CustomCommandUseLocal() const override { return true; }
private:
void GenerateTarget(cmGeneratorTarget* target) override;
-
- std::map<cmGeneratorTarget const*, std::set<cmSourceFile const*>>
- SourcesVisited;
};
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1ebd5da..362c3e7 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -86,6 +86,15 @@ void cmLocalVisualStudio7Generator::Generate()
if (!gt->IsInBuildSystem() || gt->GetProperty("EXTERNAL_MSPROJECT")) {
continue;
}
+
+ auto& gtVisited = this->GetSourcesVisited(gt);
+ auto& deps = this->GlobalGenerator->GetTargetDirectDepends(gt);
+ for (auto& d : deps) {
+ // Take the union of visited source files of custom commands
+ auto depVisited = this->GetSourcesVisited(d);
+ gtVisited.insert(depVisited.begin(), depVisited.end());
+ }
+
this->GenerateTarget(gt);
}
diff --git a/Source/cmLocalVisualStudio7Generator.h b/Source/cmLocalVisualStudio7Generator.h
index 9ccd1a1..6e06c09 100644
--- a/Source/cmLocalVisualStudio7Generator.h
+++ b/Source/cmLocalVisualStudio7Generator.h
@@ -83,6 +83,12 @@ public:
virtual void ReadAndStoreExternalGUID(const std::string& name,
const char* path);
+ std::set<cmSourceFile const*>& GetSourcesVisited(
+ cmGeneratorTarget const* target)
+ {
+ return this->SourcesVisited[target];
+ };
+
protected:
virtual void GenerateTarget(cmGeneratorTarget* target);
@@ -148,4 +154,7 @@ private:
bool FortranProject;
bool WindowsCEProject;
std::unique_ptr<cmLocalVisualStudio7GeneratorInternals> Internal;
+
+ std::map<cmGeneratorTarget const*, std::set<cmSourceFile const*>>
+ SourcesVisited;
};