diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-09-03 15:22:44 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-05 13:49:59 (GMT) |
commit | 5a365420866849ed0c5cb54ebae5ca96bd5bd984 (patch) | |
tree | 55e2e46c032e2433eb0b7b591bfd2451b6a75663 /Source | |
parent | 3059e6aed7ac3e773dd1f184558b9fd8a4b7b11e (diff) | |
download | CMake-5a365420866849ed0c5cb54ebae5ca96bd5bd984.zip CMake-5a365420866849ed0c5cb54ebae5ca96bd5bd984.tar.gz CMake-5a365420866849ed0c5cb54ebae5ca96bd5bd984.tar.bz2 |
Refactor: Add allowArch parameter to cmake::CreateGlobalGenerator()
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalGeneratorFactory.h | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio11Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio12Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio14Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio9Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudioVersionedGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmake.cxx | 4 | ||||
-rw-r--r-- | Source/cmake.h | 2 |
10 files changed, 20 insertions, 19 deletions
diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 3a7f806..d6ababb 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -25,7 +25,7 @@ public: /** Create a GlobalGenerator */ virtual std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& n, cmake* cm) const = 0; + const std::string& n, bool allowArch, cmake* cm) const = 0; /** Get the documentation entry for this factory */ virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0; @@ -53,7 +53,7 @@ class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory public: /** Create a GlobalGenerator */ std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool /*allowArch*/, cmake* cm) const override { if (name != T::GetActualName()) { return std::unique_ptr<cmGlobalGenerator>(); diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 3805546..7794df3 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -59,7 +59,7 @@ class cmGlobalVisualStudio10Generator::Factory { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool allowArch, cmake* cm) const override { std::string genName; const char* p = cmVS10GenName(name, genName); @@ -70,7 +70,7 @@ public: return std::unique_ptr<cmGlobalGenerator>( new cmGlobalVisualStudio10Generator(cm, genName, "")); } - if (*p++ != ' ') { + if (!allowArch || *p++ != ' ') { return std::unique_ptr<cmGlobalGenerator>(); } if (strcmp(p, "Win64") == 0) { diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index a385375..a5ffcf0 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -31,7 +31,7 @@ class cmGlobalVisualStudio11Generator::Factory { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool allowArch, cmake* cm) const override { std::string genName; const char* p = cmVS11GenName(name, genName); @@ -42,7 +42,7 @@ public: return std::unique_ptr<cmGlobalGenerator>( new cmGlobalVisualStudio11Generator(cm, genName, "")); } - if (*p++ != ' ') { + if (!allowArch || *p++ != ' ') { return std::unique_ptr<cmGlobalGenerator>(); } if (strcmp(p, "Win64") == 0) { diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index 5a27994..8bdf356 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -29,7 +29,7 @@ class cmGlobalVisualStudio12Generator::Factory { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool allowArch, cmake* cm) const override { std::string genName; const char* p = cmVS12GenName(name, genName); @@ -40,7 +40,7 @@ public: return std::unique_ptr<cmGlobalGenerator>( new cmGlobalVisualStudio12Generator(cm, genName, "")); } - if (*p++ != ' ') { + if (!allowArch || *p++ != ' ') { return std::unique_ptr<cmGlobalGenerator>(); } if (strcmp(p, "Win64") == 0) { diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index a12b7e1..e17c6d7 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -30,7 +30,7 @@ class cmGlobalVisualStudio14Generator::Factory { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool allowArch, cmake* cm) const override { std::string genName; const char* p = cmVS14GenName(name, genName); @@ -41,7 +41,7 @@ public: return std::unique_ptr<cmGlobalGenerator>( new cmGlobalVisualStudio14Generator(cm, genName, "")); } - if (*p++ != ' ') { + if (!allowArch || *p++ != ' ') { return std::unique_ptr<cmGlobalGenerator>(); } if (strcmp(p, "Win64") == 0) { diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 9f73c15..2339a80 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -16,7 +16,7 @@ class cmGlobalVisualStudio9Generator::Factory : public cmGlobalGeneratorFactory { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool allowArch, cmake* cm) const override { if (strncmp(name.c_str(), vs9generatorName, sizeof(vs9generatorName) - 1) != 0) { @@ -29,7 +29,7 @@ public: new cmGlobalVisualStudio9Generator(cm, name, "")); } - if (p[0] != ' ') { + if (!allowArch || p[0] != ' ') { return std::unique_ptr<cmGlobalGenerator>(); } diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 4b877ce..95357e7 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -140,7 +140,7 @@ class cmGlobalVisualStudioVersionedGenerator::Factory15 { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool allowArch, cmake* cm) const override { std::string genName; const char* p = cmVS15GenName(name, genName); @@ -152,7 +152,7 @@ public: new cmGlobalVisualStudioVersionedGenerator( cmGlobalVisualStudioGenerator::VS15, cm, genName, "")); } - if (*p++ != ' ') { + if (!allowArch || *p++ != ' ') { return std::unique_ptr<cmGlobalGenerator>(); } if (strcmp(p, "Win64") == 0) { @@ -234,7 +234,7 @@ class cmGlobalVisualStudioVersionedGenerator::Factory16 { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override + const std::string& name, bool /*allowArch*/, cmake* cm) const override { std::string genName; const char* p = cmVS16GenName(name, genName); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index f1a1ce6..952a179 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -135,7 +135,7 @@ class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory { public: std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name, cmake* cm) const override; + const std::string& name, bool allowArch, cmake* cm) const override; void GetDocumentation(cmDocumentationEntry& entry) const override { @@ -197,6 +197,7 @@ std::unique_ptr<cmGlobalGeneratorFactory> cmGlobalXCodeGenerator::NewFactory() std::unique_ptr<cmGlobalGenerator> cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(const std::string& name, + bool /*allowArch*/, cmake* cm) const { if (name != GetActualName()) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index dc06fae..9f84378 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1217,7 +1217,7 @@ createExtraGenerator( } std::unique_ptr<cmGlobalGenerator> cmake::CreateGlobalGenerator( - const std::string& gname) + const std::string& gname, bool allowArch) { std::pair<std::unique_ptr<cmExternalMakefileProjectGenerator>, std::string> extra = createExtraGenerator(this->ExtraGenerators, gname); @@ -1227,7 +1227,7 @@ std::unique_ptr<cmGlobalGenerator> cmake::CreateGlobalGenerator( std::unique_ptr<cmGlobalGenerator> generator; for (const auto& g : this->Generators) { - generator = g->CreateGlobalGenerator(name, this); + generator = g->CreateGlobalGenerator(name, allowArch, this); if (generator) { break; } diff --git a/Source/cmake.h b/Source/cmake.h index 63635cb..525af32 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -219,7 +219,7 @@ public: //! Create a GlobalGenerator std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator( - const std::string& name); + const std::string& name, bool allowArch = true); //! Return the global generator assigned to this instance of cmake cmGlobalGenerator* GetGlobalGenerator() |