diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2019-03-15 15:01:59 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2019-05-13 14:45:36 (GMT) |
commit | b133d14fb1c0183c647136188cf4fff0ed05c58e (patch) | |
tree | 5505820b876ec4b4182b537ec069c8a1acb059bc | |
parent | 741fb95f660c73035a26b572dfcd3d628d324d57 (diff) | |
download | CMake-b133d14fb1c0183c647136188cf4fff0ed05c58e.zip CMake-b133d14fb1c0183c647136188cf4fff0ed05c58e.tar.gz CMake-b133d14fb1c0183c647136188cf4fff0ed05c58e.tar.bz2 |
Refactor: Allow cmInstallGenerator::Compute() to return an error
This is preparation for an upcoming merge request, which will add
a new cmInstallGenerator that returns false if there are errors in
the Compute() step.
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmInstallDirectoryGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmInstallDirectoryGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallExportAndroidMKGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallExportAndroidMKGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallExportGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallExportGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallFilesGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallFilesGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallScriptGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmInstallScriptGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallSubdirectoryGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmInstallSubdirectoryGenerator.h | 2 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.cxx | 4 | ||||
-rw-r--r-- | Source/cmInstallTargetGenerator.h | 2 |
16 files changed, 28 insertions, 17 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 8223dd1..b08dd1c 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1372,7 +1372,9 @@ bool cmGlobalGenerator::Compute() for (cmLocalGenerator* localGen : this->LocalGenerators) { cmMakefile* mf = localGen->GetMakefile(); for (cmInstallGenerator* g : mf->GetInstallGenerators()) { - g->Compute(localGen); + if (!g->Compute(localGen)) { + return false; + } } } diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx index 62ce9f2..14288f6 100644 --- a/Source/cmInstallDirectoryGenerator.cxx +++ b/Source/cmInstallDirectoryGenerator.cxx @@ -43,9 +43,10 @@ cmInstallDirectoryGenerator::cmInstallDirectoryGenerator( cmInstallDirectoryGenerator::~cmInstallDirectoryGenerator() = default; -void cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallDirectoryGenerator::Compute(cmLocalGenerator* lg) { - LocalGenerator = lg; + this->LocalGenerator = lg; + return true; } void cmInstallDirectoryGenerator::GenerateScriptActions(std::ostream& os, diff --git a/Source/cmInstallDirectoryGenerator.h b/Source/cmInstallDirectoryGenerator.h index ac6e504..e30849f 100644 --- a/Source/cmInstallDirectoryGenerator.h +++ b/Source/cmInstallDirectoryGenerator.h @@ -29,7 +29,7 @@ public: bool optional = false); ~cmInstallDirectoryGenerator() override; - void Compute(cmLocalGenerator* lg) override; + bool Compute(cmLocalGenerator* lg) override; std::string GetDestination(std::string const& config) const; diff --git a/Source/cmInstallExportAndroidMKGenerator.cxx b/Source/cmInstallExportAndroidMKGenerator.cxx index 186b9df..7de3dd4 100644 --- a/Source/cmInstallExportAndroidMKGenerator.cxx +++ b/Source/cmInstallExportAndroidMKGenerator.cxx @@ -30,10 +30,11 @@ cmInstallExportAndroidMKGenerator::~cmInstallExportAndroidMKGenerator() { } -void cmInstallExportAndroidMKGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallExportAndroidMKGenerator::Compute(cmLocalGenerator* lg) { this->LocalGenerator = lg; this->ExportSet->Compute(lg); + return true; } void cmInstallExportAndroidMKGenerator::GenerateScript(std::ostream& os) diff --git a/Source/cmInstallExportAndroidMKGenerator.h b/Source/cmInstallExportAndroidMKGenerator.h index 189084a..a92ff27 100644 --- a/Source/cmInstallExportAndroidMKGenerator.h +++ b/Source/cmInstallExportAndroidMKGenerator.h @@ -24,7 +24,7 @@ public: const char* name_space, bool exportOld); ~cmInstallExportAndroidMKGenerator(); - void Compute(cmLocalGenerator* lg); + bool Compute(cmLocalGenerator* lg) override; protected: virtual void GenerateScript(std::ostream& os); diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 73a37cb..f5bedab 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -45,10 +45,11 @@ cmInstallExportGenerator::~cmInstallExportGenerator() delete this->EFGen; } -void cmInstallExportGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallExportGenerator::Compute(cmLocalGenerator* lg) { this->LocalGenerator = lg; this->ExportSet->Compute(lg); + return true; } void cmInstallExportGenerator::ComputeTempDir() diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h index d23cf06..c4d252c 100644 --- a/Source/cmInstallExportGenerator.h +++ b/Source/cmInstallExportGenerator.h @@ -34,7 +34,7 @@ public: cmExportSet* GetExportSet() { return this->ExportSet; } - void Compute(cmLocalGenerator* lg) override; + bool Compute(cmLocalGenerator* lg) override; cmLocalGenerator* GetLocalGenerator() const { return this->LocalGenerator; } diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx index 9eb8ad4..2ed9f73 100644 --- a/Source/cmInstallFilesGenerator.cxx +++ b/Source/cmInstallFilesGenerator.cxx @@ -42,9 +42,10 @@ cmInstallFilesGenerator::cmInstallFilesGenerator( cmInstallFilesGenerator::~cmInstallFilesGenerator() = default; -void cmInstallFilesGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallFilesGenerator::Compute(cmLocalGenerator* lg) { this->LocalGenerator = lg; + return true; } std::string cmInstallFilesGenerator::GetDestination( diff --git a/Source/cmInstallFilesGenerator.h b/Source/cmInstallFilesGenerator.h index 0ef2a06..ac462d4 100644 --- a/Source/cmInstallFilesGenerator.h +++ b/Source/cmInstallFilesGenerator.h @@ -29,7 +29,7 @@ public: bool optional = false); ~cmInstallFilesGenerator() override; - void Compute(cmLocalGenerator* lg) override; + bool Compute(cmLocalGenerator* lg) override; std::string GetDestination(std::string const& config) const; diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h index 9bd7ac3..dbe707d 100644 --- a/Source/cmInstallGenerator.h +++ b/Source/cmInstallGenerator.h @@ -60,7 +60,7 @@ public: /** Select message level from CMAKE_INSTALL_MESSAGE or 'never'. */ static MessageLevel SelectMessageLevel(cmMakefile* mf, bool never = false); - virtual void Compute(cmLocalGenerator*) {} + virtual bool Compute(cmLocalGenerator*) { return true; } protected: void GenerateScript(std::ostream& os) override; diff --git a/Source/cmInstallScriptGenerator.cxx b/Source/cmInstallScriptGenerator.cxx index a513958..5832d27 100644 --- a/Source/cmInstallScriptGenerator.cxx +++ b/Source/cmInstallScriptGenerator.cxx @@ -29,7 +29,7 @@ cmInstallScriptGenerator::cmInstallScriptGenerator(const char* script, cmInstallScriptGenerator::~cmInstallScriptGenerator() = default; -void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallScriptGenerator::Compute(cmLocalGenerator* lg) { this->LocalGenerator = lg; @@ -49,6 +49,8 @@ void cmInstallScriptGenerator::Compute(cmLocalGenerator* lg) break; } } + + return true; } void cmInstallScriptGenerator::AddScriptInstallRule(std::ostream& os, diff --git a/Source/cmInstallScriptGenerator.h b/Source/cmInstallScriptGenerator.h index 05199d7..6af7371 100644 --- a/Source/cmInstallScriptGenerator.h +++ b/Source/cmInstallScriptGenerator.h @@ -23,7 +23,7 @@ public: const char* component, bool exclude_from_all); ~cmInstallScriptGenerator() override; - void Compute(cmLocalGenerator* lg) override; + bool Compute(cmLocalGenerator* lg) override; protected: void GenerateScriptActions(std::ostream& os, Indent indent) override; diff --git a/Source/cmInstallSubdirectoryGenerator.cxx b/Source/cmInstallSubdirectoryGenerator.cxx index ad7121f..1c0512c 100644 --- a/Source/cmInstallSubdirectoryGenerator.cxx +++ b/Source/cmInstallSubdirectoryGenerator.cxx @@ -41,9 +41,10 @@ void cmInstallSubdirectoryGenerator::CheckCMP0082( } } -void cmInstallSubdirectoryGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallSubdirectoryGenerator::Compute(cmLocalGenerator* lg) { this->LocalGenerator = lg; + return true; } void cmInstallSubdirectoryGenerator::GenerateScript(std::ostream& os) diff --git a/Source/cmInstallSubdirectoryGenerator.h b/Source/cmInstallSubdirectoryGenerator.h index 35471dd..22759d9 100644 --- a/Source/cmInstallSubdirectoryGenerator.h +++ b/Source/cmInstallSubdirectoryGenerator.h @@ -28,7 +28,7 @@ public: void CheckCMP0082(bool& haveSubdirectoryInstall, bool& haveInstallAfterSubdirectory) override; - void Compute(cmLocalGenerator* lg) override; + bool Compute(cmLocalGenerator* lg) override; protected: void GenerateScript(std::ostream& os) override; diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx index 4fefe23..7c5a55b 100644 --- a/Source/cmInstallTargetGenerator.cxx +++ b/Source/cmInstallTargetGenerator.cxx @@ -430,7 +430,7 @@ std::string cmInstallTargetGenerator::GetInstallFilename( return fname; } -void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) +bool cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) { // Lookup this target in the current directory. this->Target = lg->FindLocalNonAliasGeneratorTarget(this->TargetName); @@ -439,6 +439,8 @@ void cmInstallTargetGenerator::Compute(cmLocalGenerator* lg) this->Target = lg->GetGlobalGenerator()->FindGeneratorTarget(this->TargetName); } + + return true; } void cmInstallTargetGenerator::AddTweak(std::ostream& os, Indent indent, diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h index 6df5b1a..ed3ab52 100644 --- a/Source/cmInstallTargetGenerator.h +++ b/Source/cmInstallTargetGenerator.h @@ -58,7 +58,7 @@ public: const std::string& config, NameType nameType = NameNormal); - void Compute(cmLocalGenerator* lg) override; + bool Compute(cmLocalGenerator* lg) override; cmGeneratorTarget* GetTarget() const { return this->Target; } |