summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalGenerator.cxx9
-rw-r--r--Source/cmGlobalGenerator.h11
-rw-r--r--Source/cmGlobalVisualStudioGenerator.h5
-rw-r--r--Source/cmGlobalXCodeGenerator.h5
4 files changed, 29 insertions, 1 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1197db6dda..fc40d63b3f 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 b532a439c0..c106258adb 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -597,6 +597,17 @@ protected:
std::string GetPredefinedTargetsFolder();
+ 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 3c464083c1..3bfcbd04d9 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 5b052143a3..ab5eeb2dd0 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,