diff options
author | Brad King <brad.king@kitware.com> | 2020-11-24 13:40:10 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-24 13:42:33 (GMT) |
commit | aee981e2084b8efdae43d0f646f9b9b7d58a6256 (patch) | |
tree | d42e235dfe3af50cae2c2f0de26af6dfc66df1a7 | |
parent | ec880f9f35baf33f31eddfd953e882ed2e4ad74d (diff) | |
parent | ef91fb02f3658954b631e46858e254008ca58132 (diff) | |
download | CMake-aee981e2084b8efdae43d0f646f9b9b7d58a6256.zip CMake-aee981e2084b8efdae43d0f646f9b9b7d58a6256.tar.gz CMake-aee981e2084b8efdae43d0f646f9b9b7d58a6256.tar.bz2 |
Merge topic 'fix-find-make-program'
ef91fb02f3 cmGlobalGenerator: FindMakeProgram() at a generator-specific time
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Frank Dana <ferdnyc@gmail.com>
Merge-request: !5529
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 9 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 11 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioGenerator.h | 5 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.h | 5 |
4 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index 52f1d52..9d84313 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -584,7 +584,8 @@ void cmGlobalGenerator::EnableLanguage( // Find the native build tool for this generator. // This has to be done early so that MSBuild can be used to examine the // cross-compilation environment. - if (!this->FindMakeProgram(mf)) { + if (this->GetFindMakeProgramStage() == FindMakeProgramStage::Early && + !this->FindMakeProgram(mf)) { return; } } @@ -660,6 +661,12 @@ void cmGlobalGenerator::EnableLanguage( cmSystemTools::SetFatalErrorOccured(); return; } + + // Find the native build tool for this generator. + if (this->GetFindMakeProgramStage() == FindMakeProgramStage::Late && + !this->FindMakeProgram(mf)) { + return; + } } // Check that the languages are supported by the generator and its diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index afafba9..c1813d0 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -604,6 +604,17 @@ protected: std::string GetPredefinedTargetsFolder() const; + enum class FindMakeProgramStage + { + Early, + Late, + }; + + virtual FindMakeProgramStage GetFindMakeProgramStage() const + { + return FindMakeProgramStage::Late; + } + private: using TargetMap = std::unordered_map<std::string, cmTarget*>; using GeneratorTargetMap = diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 3c46408..3bfcbd0 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -166,6 +166,11 @@ protected: void WriteSLNHeader(std::ostream& fout); + FindMakeProgramStage GetFindMakeProgramStage() const override + { + return FindMakeProgramStage::Early; + } + bool ComputeTargetDepends() override; class VSDependSet : public std::set<std::string> { diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h index 5b05214..ab5eeb2 100644 --- a/Source/cmGlobalXCodeGenerator.h +++ b/Source/cmGlobalXCodeGenerator.h @@ -124,6 +124,11 @@ protected: void AddExtraIDETargets() override; void Generate() override; + FindMakeProgramStage GetFindMakeProgramStage() const override + { + return FindMakeProgramStage::Early; + } + private: bool ParseGeneratorToolset(std::string const& ts, cmMakefile* mf); bool ProcessGeneratorToolsetField(std::string const& key, |