VS: Remove support for appending a platform to the generator name
Compatibility with CMake versions prior to 3.1 is no longer supported. Fixes: #26481
This commit is contained in:
parent
dc24d88062
commit
381c446ff7
@ -25,15 +25,18 @@ name (architecture). For example:
|
||||
* ``cmake -G "Visual Studio 14 2015" -A x64``
|
||||
* ``cmake -G "Visual Studio 14 2015" -A ARM``
|
||||
|
||||
For compatibility with CMake versions prior to 3.1, one may specify
|
||||
a target platform name optionally at the end of the generator name.
|
||||
This is supported only for:
|
||||
.. versionchanged:: 4.0
|
||||
|
||||
``Visual Studio 14 2015 Win64``
|
||||
Specify target platform ``x64``.
|
||||
Previously, for compatibility with CMake versions prior to 3.1,
|
||||
one could specify a target platform name optionally at the
|
||||
end of the generator name. This has been removed.
|
||||
This was supported only for:
|
||||
|
||||
``Visual Studio 14 2015 ARM``
|
||||
Specify target platform ``ARM``.
|
||||
``Visual Studio 14 2015 Win64``
|
||||
Specify target platform ``x64``.
|
||||
|
||||
``Visual Studio 14 2015 ARM``
|
||||
Specify target platform ``ARM``.
|
||||
|
||||
Toolset Selection
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
@ -34,15 +34,18 @@ name (architecture). For example:
|
||||
* ``cmake -G "Visual Studio 15 2017" -A ARM``
|
||||
* ``cmake -G "Visual Studio 15 2017" -A ARM64``
|
||||
|
||||
For compatibility with CMake versions prior to 3.1, one may specify
|
||||
a target platform name optionally at the end of the generator name.
|
||||
This is supported only for:
|
||||
.. versionchanged:: 4.0
|
||||
|
||||
``Visual Studio 15 2017 Win64``
|
||||
Specify target platform ``x64``.
|
||||
Previously, for compatibility with CMake versions prior to 3.1,
|
||||
one could specify a target platform name optionally at the
|
||||
end of the generator name. This has been removed.
|
||||
This was supported only for:
|
||||
|
||||
``Visual Studio 15 2017 ARM``
|
||||
Specify target platform ``ARM``.
|
||||
``Visual Studio 15 2017 Win64``
|
||||
Specify target platform ``x64``.
|
||||
|
||||
``Visual Studio 15 2017 ARM``
|
||||
Specify target platform ``ARM``.
|
||||
|
||||
Toolset Selection
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
@ -8,3 +8,7 @@ remove-old-compatibility
|
||||
CMake by using their ``VERSION`` arguments' ``<min>...<max>`` syntax.
|
||||
This requires only the ``<min>`` version of CMake, but when running a
|
||||
newer version, sets policies up to the ``<max>`` version.
|
||||
|
||||
* The :generator:`Visual Studio 14 2015` and :generator:`Visual Studio 15 2017`
|
||||
generators no longer support specifying a platform as part of the generator
|
||||
name. See :ref:`Visual Studio Platform Selection`.
|
||||
|
@ -59,8 +59,7 @@ QCMake::QCMake(QObject* p)
|
||||
[this] { return this->interruptCallback(); });
|
||||
|
||||
std::vector<cmake::GeneratorInfo> generators;
|
||||
this->CMakeInstance->GetRegisteredGenerators(
|
||||
generators, /*includeNamesWithPlatform=*/false);
|
||||
this->CMakeInstance->GetRegisteredGenerators(generators);
|
||||
|
||||
for (cmake::GeneratorInfo const& gen : generators) {
|
||||
this->AvailableGenerators.push_back(gen);
|
||||
|
@ -28,14 +28,13 @@ public:
|
||||
|
||||
/** Create a GlobalGenerator */
|
||||
virtual std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& n, bool allowArch, cmake* cm) const = 0;
|
||||
const std::string& n, cmake* cm) const = 0;
|
||||
|
||||
/** Get the documentation entry for this factory */
|
||||
virtual cmDocumentationEntry GetDocumentation() const = 0;
|
||||
|
||||
/** Get the names of the current registered generators */
|
||||
virtual std::vector<std::string> GetGeneratorNames() const = 0;
|
||||
virtual std::vector<std::string> GetGeneratorNamesWithPlatform() const = 0;
|
||||
|
||||
/** Determine whether or not this generator supports toolsets */
|
||||
virtual bool SupportsToolset() const = 0;
|
||||
@ -56,7 +55,7 @@ class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory
|
||||
public:
|
||||
/** Create a GlobalGenerator */
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool /*allowArch*/, cmake* cm) const override
|
||||
const std::string& name, cmake* cm) const override
|
||||
{
|
||||
if (name != T::GetActualName()) {
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
@ -75,10 +74,6 @@ public:
|
||||
{
|
||||
return { T::GetActualName() };
|
||||
}
|
||||
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
/** Determine whether or not this generator supports toolsets */
|
||||
bool SupportsToolset() const override { return T::SupportsToolset(); }
|
||||
|
@ -53,9 +53,8 @@ static void ConvertToWindowsSlashes(std::string& s)
|
||||
}
|
||||
|
||||
cmGlobalVisualStudio10Generator::cmGlobalVisualStudio10Generator(
|
||||
cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudio8Generator(cm, name, platformInGeneratorName)
|
||||
cmake* cm, const std::string& name)
|
||||
: cmGlobalVisualStudio8Generator(cm, name)
|
||||
{
|
||||
this->DefaultCudaFlagTableName = "v10";
|
||||
this->DefaultCudaHostFlagTableName = "v10";
|
||||
@ -485,13 +484,6 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
|
||||
return false;
|
||||
}
|
||||
} else if (this->SystemName == "Android"_s) {
|
||||
if (this->PlatformInGeneratorName) {
|
||||
mf->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
cmStrCat("CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR ",
|
||||
"specifies a platform too: '", this->GetName(), '\''));
|
||||
return false;
|
||||
}
|
||||
if (mf->GetSafeDefinition("CMAKE_GENERATOR_PLATFORM") ==
|
||||
"Tegra-Android"_s) {
|
||||
if (!this->InitializeTegraAndroid(mf)) {
|
||||
@ -513,16 +505,8 @@ bool cmGlobalVisualStudio10Generator::InitializeWindows(cmMakefile*)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
|
||||
bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile*)
|
||||
{
|
||||
if (this->PlatformInGeneratorName) {
|
||||
mf->IssueMessage(
|
||||
MessageType::FATAL_ERROR,
|
||||
cmStrCat("CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR ",
|
||||
"specifies a platform too: '", this->GetName(), '\''));
|
||||
return false;
|
||||
}
|
||||
|
||||
this->DefaultPlatformToolset = this->SelectWindowsCEToolset();
|
||||
|
||||
return true;
|
||||
|
@ -185,8 +185,7 @@ public:
|
||||
bool IsBuildInParallelSupported() const;
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudio10Generator(cmake* cm, const std::string& name);
|
||||
|
||||
void Generate() override;
|
||||
virtual bool InitializeSystem(cmMakefile* mf);
|
||||
|
@ -16,9 +16,8 @@
|
||||
#include "cmSystemTools.h"
|
||||
|
||||
cmGlobalVisualStudio11Generator::cmGlobalVisualStudio11Generator(
|
||||
cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudio10Generator(cm, name, platformInGeneratorName)
|
||||
cmake* cm, const std::string& name)
|
||||
: cmGlobalVisualStudio10Generator(cm, name)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -31,8 +31,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudio11Generator(cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudio11Generator(cmake* cm, const std::string& name);
|
||||
|
||||
bool InitializeWindowsPhone(cmMakefile* mf) override;
|
||||
bool InitializeWindowsStore(cmMakefile* mf) override;
|
||||
|
@ -16,9 +16,8 @@
|
||||
#include "cmSystemTools.h"
|
||||
|
||||
cmGlobalVisualStudio12Generator::cmGlobalVisualStudio12Generator(
|
||||
cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudio11Generator(cm, name, platformInGeneratorName)
|
||||
cmake* cm, const std::string& name)
|
||||
: cmGlobalVisualStudio11Generator(cm, name)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,7 @@ class cmake;
|
||||
class cmGlobalVisualStudio12Generator : public cmGlobalVisualStudio11Generator
|
||||
{
|
||||
protected:
|
||||
cmGlobalVisualStudio12Generator(cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudio12Generator(cmake* cm, const std::string& name);
|
||||
|
||||
bool ProcessGeneratorToolsetField(std::string const& key,
|
||||
std::string const& value) override;
|
||||
|
@ -40,7 +40,7 @@ class cmGlobalVisualStudio14Generator::Factory
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool allowArch, cmake* cm) const override
|
||||
const std::string& name, cmake* cm) const override
|
||||
{
|
||||
std::string genName;
|
||||
const char* p = cmVS14GenName(name, genName);
|
||||
@ -49,18 +49,7 @@ public:
|
||||
}
|
||||
if (!*p) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudio14Generator(cm, genName, ""));
|
||||
}
|
||||
if (!allowArch || *p++ != ' ') {
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
}
|
||||
if (strcmp(p, "Win64") == 0) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudio14Generator(cm, genName, "x64"));
|
||||
}
|
||||
if (strcmp(p, "ARM") == 0) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudio14Generator(cm, genName, "ARM"));
|
||||
new cmGlobalVisualStudio14Generator(cm, genName));
|
||||
}
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
}
|
||||
@ -79,14 +68,6 @@ public:
|
||||
return names;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
names.emplace_back(cmStrCat(vs14generatorName, " ARM"));
|
||||
names.emplace_back(cmStrCat(vs14generatorName, " Win64"));
|
||||
return names;
|
||||
}
|
||||
|
||||
bool SupportsToolset() const override { return true; }
|
||||
bool SupportsPlatform() const override { return true; }
|
||||
|
||||
@ -109,9 +90,8 @@ cmGlobalVisualStudio14Generator::NewFactory()
|
||||
}
|
||||
|
||||
cmGlobalVisualStudio14Generator::cmGlobalVisualStudio14Generator(
|
||||
cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudio12Generator(cm, name, platformInGeneratorName)
|
||||
cmake* cm, const std::string& name)
|
||||
: cmGlobalVisualStudio12Generator(cm, name)
|
||||
{
|
||||
std::string vc14Express;
|
||||
this->ExpressEdition = cmSystemTools::ReadRegistryValue(
|
||||
|
@ -29,8 +29,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudio14Generator(cmake* cm, const std::string& name);
|
||||
|
||||
bool InitializeWindowsStore(cmMakefile* mf) override;
|
||||
bool InitializeAndroid(cmMakefile* mf) override;
|
||||
|
@ -17,9 +17,8 @@
|
||||
|
||||
class cmake;
|
||||
|
||||
cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
|
||||
cmake* cm, const std::string& platformName)
|
||||
: cmGlobalVisualStudio7Generator(cm, platformName)
|
||||
cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(cmake* cm)
|
||||
: cmGlobalVisualStudio7Generator(cm)
|
||||
{
|
||||
this->ProjectConfigurationSectionName = "ProjectConfiguration";
|
||||
}
|
||||
|
@ -25,8 +25,7 @@ class BT;
|
||||
class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator
|
||||
{
|
||||
public:
|
||||
cmGlobalVisualStudio71Generator(cmake* cm,
|
||||
const std::string& platformName = "");
|
||||
cmGlobalVisualStudio71Generator(cmake* cm);
|
||||
|
||||
protected:
|
||||
void WriteSLNFile(std::ostream& fout, cmLocalGenerator* root,
|
||||
|
@ -66,9 +66,8 @@ std::string GetSLNFile(cmLocalGenerator* root)
|
||||
}
|
||||
}
|
||||
|
||||
cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(
|
||||
cmake* cm, std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudioGenerator(cm, platformInGeneratorName)
|
||||
cmGlobalVisualStudio7Generator::cmGlobalVisualStudio7Generator(cmake* cm)
|
||||
: cmGlobalVisualStudioGenerator(cm)
|
||||
{
|
||||
this->DevEnvCommandInitialized = false;
|
||||
this->MarmasmEnabled = false;
|
||||
|
@ -130,8 +130,7 @@ public:
|
||||
virtual bool SupportsCxxModuleDyndep() const { return false; }
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudio7Generator(cmake* cm,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudio7Generator(cmake* cm);
|
||||
|
||||
void Generate() override;
|
||||
|
||||
|
@ -39,9 +39,8 @@
|
||||
struct cmIDEFlagTable;
|
||||
|
||||
cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator(
|
||||
cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudio71Generator(cm, platformInGeneratorName)
|
||||
cmake* cm, const std::string& name)
|
||||
: cmGlobalVisualStudio71Generator(cm)
|
||||
{
|
||||
this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms";
|
||||
this->Name = name;
|
||||
@ -88,13 +87,6 @@ void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf)
|
||||
bool cmGlobalVisualStudio8Generator::SetGeneratorPlatform(std::string const& p,
|
||||
cmMakefile* mf)
|
||||
{
|
||||
if (this->PlatformInGeneratorName) {
|
||||
// This is an old-style generator name that contains the platform name.
|
||||
// No explicit platform specification is supported, so pass it through
|
||||
// to our base class implementation, which errors on non-empty platforms.
|
||||
return this->cmGlobalVisualStudio7Generator::SetGeneratorPlatform(p, mf);
|
||||
}
|
||||
|
||||
if (!this->ParseGeneratorPlatform(p, mf)) {
|
||||
return false;
|
||||
}
|
||||
|
@ -51,8 +51,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudio8Generator(cmake* cm, const std::string& name);
|
||||
|
||||
virtual bool ProcessGeneratorPlatformField(std::string const& key,
|
||||
std::string const& value);
|
||||
|
@ -36,20 +36,13 @@
|
||||
#include "cmTarget.h"
|
||||
#include "cmake.h"
|
||||
|
||||
cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(
|
||||
cmake* cm, std::string const& platformInGeneratorName)
|
||||
cmGlobalVisualStudioGenerator::cmGlobalVisualStudioGenerator(cmake* cm)
|
||||
: cmGlobalGenerator(cm)
|
||||
{
|
||||
cm->GetState()->SetIsGeneratorMultiConfig(true);
|
||||
cm->GetState()->SetWindowsShell(true);
|
||||
cm->GetState()->SetWindowsVSIDE(true);
|
||||
|
||||
if (platformInGeneratorName.empty()) {
|
||||
this->DefaultPlatformName = "Win32";
|
||||
} else {
|
||||
this->DefaultPlatformName = platformInGeneratorName;
|
||||
this->PlatformInGeneratorName = true;
|
||||
}
|
||||
this->DefaultPlatformName = "Win32";
|
||||
}
|
||||
|
||||
cmGlobalVisualStudioGenerator::~cmGlobalVisualStudioGenerator() = default;
|
||||
|
@ -159,8 +159,7 @@ public:
|
||||
bool IsVisualStudio() const override { return true; }
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudioGenerator(cmake* cm,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudioGenerator(cmake* cm);
|
||||
|
||||
virtual bool InitializePlatform(cmMakefile* mf);
|
||||
|
||||
@ -195,7 +194,6 @@ protected:
|
||||
|
||||
std::string GeneratorPlatform;
|
||||
std::string DefaultPlatformName;
|
||||
bool PlatformInGeneratorName = false;
|
||||
|
||||
private:
|
||||
virtual std::string GetVSMakeProgram() = 0;
|
||||
|
@ -205,7 +205,7 @@ class cmGlobalVisualStudioVersionedGenerator::Factory15
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool allowArch, cmake* cm) const override
|
||||
const std::string& name, cmake* cm) const override
|
||||
{
|
||||
std::string genName;
|
||||
const char* p = cmVS15GenName(name, genName);
|
||||
@ -215,20 +215,7 @@ public:
|
||||
if (!*p) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudioVersionedGenerator(
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS15, cm, genName, ""));
|
||||
}
|
||||
if (!allowArch || *p++ != ' ') {
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
}
|
||||
if (strcmp(p, "Win64") == 0) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudioVersionedGenerator(
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS15, cm, genName, "x64"));
|
||||
}
|
||||
if (strcmp(p, "ARM") == 0) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudioVersionedGenerator(
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS15, cm, genName, "ARM"));
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS15, cm, genName));
|
||||
}
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
}
|
||||
@ -247,14 +234,6 @@ public:
|
||||
return names;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
|
||||
{
|
||||
std::vector<std::string> names;
|
||||
names.emplace_back(cmStrCat(vs15generatorName, " ARM"));
|
||||
names.emplace_back(cmStrCat(vs15generatorName, " Win64"));
|
||||
return names;
|
||||
}
|
||||
|
||||
bool SupportsToolset() const override { return true; }
|
||||
bool SupportsPlatform() const override { return true; }
|
||||
|
||||
@ -314,7 +293,7 @@ class cmGlobalVisualStudioVersionedGenerator::Factory16
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool /*allowArch*/, cmake* cm) const override
|
||||
const std::string& name, cmake* cm) const override
|
||||
{
|
||||
std::string genName;
|
||||
const char* p = cmVS16GenName(name, genName);
|
||||
@ -324,7 +303,7 @@ public:
|
||||
if (!*p) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudioVersionedGenerator(
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS16, cm, genName, ""));
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS16, cm, genName));
|
||||
}
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
}
|
||||
@ -343,11 +322,6 @@ public:
|
||||
return names;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
bool SupportsToolset() const override { return true; }
|
||||
bool SupportsPlatform() const override { return true; }
|
||||
|
||||
@ -379,7 +353,7 @@ class cmGlobalVisualStudioVersionedGenerator::Factory17
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool /*allowArch*/, cmake* cm) const override
|
||||
const std::string& name, cmake* cm) const override
|
||||
{
|
||||
std::string genName;
|
||||
const char* p = cmVS17GenName(name, genName);
|
||||
@ -389,7 +363,7 @@ public:
|
||||
if (!*p) {
|
||||
return std::unique_ptr<cmGlobalGenerator>(
|
||||
new cmGlobalVisualStudioVersionedGenerator(
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS17, cm, genName, ""));
|
||||
cmGlobalVisualStudioGenerator::VSVersion::VS17, cm, genName));
|
||||
}
|
||||
return std::unique_ptr<cmGlobalGenerator>();
|
||||
}
|
||||
@ -408,11 +382,6 @@ public:
|
||||
return names;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
bool SupportsToolset() const override { return true; }
|
||||
bool SupportsPlatform() const override { return true; }
|
||||
|
||||
@ -440,9 +409,8 @@ cmGlobalVisualStudioVersionedGenerator::NewFactory17()
|
||||
}
|
||||
|
||||
cmGlobalVisualStudioVersionedGenerator::cmGlobalVisualStudioVersionedGenerator(
|
||||
VSVersion version, cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName)
|
||||
: cmGlobalVisualStudio14Generator(cm, name, platformInGeneratorName)
|
||||
VSVersion version, cmake* cm, const std::string& name)
|
||||
: cmGlobalVisualStudio14Generator(cm, name)
|
||||
, vsSetupAPIHelper(VSVersionToMajor(version))
|
||||
{
|
||||
this->Version = version;
|
||||
|
@ -58,9 +58,8 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
cmGlobalVisualStudioVersionedGenerator(
|
||||
VSVersion version, cmake* cm, const std::string& name,
|
||||
std::string const& platformInGeneratorName);
|
||||
cmGlobalVisualStudioVersionedGenerator(VSVersion version, cmake* cm,
|
||||
const std::string& name);
|
||||
|
||||
bool SelectWindowsStoreToolset(std::string& toolset) const override;
|
||||
|
||||
|
@ -148,7 +148,7 @@ class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool allowArch, cmake* cm) const override;
|
||||
const std::string& name, cmake* cm) const override;
|
||||
|
||||
cmDocumentationEntry GetDocumentation() const override
|
||||
{
|
||||
@ -162,11 +162,6 @@ public:
|
||||
return names;
|
||||
}
|
||||
|
||||
std::vector<std::string> GetGeneratorNamesWithPlatform() const override
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
bool SupportsToolset() const override { return true; }
|
||||
bool SupportsPlatform() const override { return false; }
|
||||
|
||||
@ -210,7 +205,6 @@ 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()) {
|
||||
|
@ -1380,7 +1380,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
|
||||
"-G", "No generator specified for -G", CommandArgument::Values::One,
|
||||
CommandArgument::RequiresSeparator::No,
|
||||
[&](std::string const& value, cmake* state) -> bool {
|
||||
bool valid = state->CreateAndSetGlobalGenerator(value, true);
|
||||
bool valid = state->CreateAndSetGlobalGenerator(value);
|
||||
badGeneratorName = !valid;
|
||||
return valid;
|
||||
});
|
||||
@ -1569,8 +1569,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
|
||||
this->SetHomeOutputDirectory(expandedPreset->BinaryDir);
|
||||
}
|
||||
if (!this->GlobalGenerator && !expandedPreset->Generator.empty()) {
|
||||
if (!this->CreateAndSetGlobalGenerator(expandedPreset->Generator,
|
||||
false)) {
|
||||
if (!this->CreateAndSetGlobalGenerator(expandedPreset->Generator)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1940,16 +1939,12 @@ void cmake::AddDefaultExtraGenerators()
|
||||
#endif
|
||||
}
|
||||
|
||||
void cmake::GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
|
||||
bool includeNamesWithPlatform) const
|
||||
void cmake::GetRegisteredGenerators(
|
||||
std::vector<GeneratorInfo>& generators) const
|
||||
{
|
||||
for (const auto& gen : this->Generators) {
|
||||
std::vector<std::string> names = gen->GetGeneratorNames();
|
||||
|
||||
if (includeNamesWithPlatform) {
|
||||
cm::append(names, gen->GetGeneratorNamesWithPlatform());
|
||||
}
|
||||
|
||||
for (std::string const& name : names) {
|
||||
GeneratorInfo info;
|
||||
info.supportsToolset = gen->SupportsToolset();
|
||||
@ -2017,7 +2012,7 @@ createExtraGenerator(
|
||||
}
|
||||
|
||||
std::unique_ptr<cmGlobalGenerator> cmake::CreateGlobalGenerator(
|
||||
const std::string& gname, bool allowArch)
|
||||
const std::string& gname)
|
||||
{
|
||||
std::pair<std::unique_ptr<cmExternalMakefileProjectGenerator>, std::string>
|
||||
extra = createExtraGenerator(this->ExtraGenerators, gname);
|
||||
@ -2027,7 +2022,7 @@ std::unique_ptr<cmGlobalGenerator> cmake::CreateGlobalGenerator(
|
||||
|
||||
std::unique_ptr<cmGlobalGenerator> generator;
|
||||
for (const auto& g : this->Generators) {
|
||||
generator = g->CreateGlobalGenerator(name, allowArch, this);
|
||||
generator = g->CreateGlobalGenerator(name, this);
|
||||
if (generator) {
|
||||
break;
|
||||
}
|
||||
@ -2040,17 +2035,16 @@ std::unique_ptr<cmGlobalGenerator> cmake::CreateGlobalGenerator(
|
||||
return generator;
|
||||
}
|
||||
|
||||
bool cmake::CreateAndSetGlobalGenerator(const std::string& name,
|
||||
bool allowArch)
|
||||
bool cmake::CreateAndSetGlobalGenerator(const std::string& name)
|
||||
{
|
||||
auto gen = this->CreateGlobalGenerator(name, allowArch);
|
||||
auto gen = this->CreateGlobalGenerator(name);
|
||||
if (!gen) {
|
||||
std::string kdevError;
|
||||
std::string vsError;
|
||||
if (name.find("KDevelop3", 0) != std::string::npos) {
|
||||
kdevError = "\nThe KDevelop3 generator is not supported anymore.";
|
||||
}
|
||||
if (!allowArch && cmHasLiteralPrefix(name, "Visual Studio ") &&
|
||||
if (cmHasLiteralPrefix(name, "Visual Studio ") &&
|
||||
name.length() >= cmStrLen("Visual Studio xx xxxx ")) {
|
||||
vsError = "\nUsing platforms in Visual Studio generator names is not "
|
||||
"supported in CMakePresets.json.";
|
||||
@ -2070,7 +2064,7 @@ bool cmake::CreateAndSetGlobalGenerator(const std::string& name,
|
||||
void cmake::PrintPresetList(const cmCMakePresetsGraph& graph) const
|
||||
{
|
||||
std::vector<GeneratorInfo> generators;
|
||||
this->GetRegisteredGenerators(generators, false);
|
||||
this->GetRegisteredGenerators(generators);
|
||||
auto filter =
|
||||
[&generators](const cmCMakePresetsGraph::ConfigurePreset& preset) -> bool {
|
||||
if (preset.Generator.empty()) {
|
||||
|
@ -246,10 +246,10 @@ public:
|
||||
|
||||
//! Create a GlobalGenerator
|
||||
std::unique_ptr<cmGlobalGenerator> CreateGlobalGenerator(
|
||||
const std::string& name, bool allowArch = true);
|
||||
const std::string& name);
|
||||
|
||||
//! Create a GlobalGenerator and set it as our own
|
||||
bool CreateAndSetGlobalGenerator(const std::string& name, bool allowArch);
|
||||
bool CreateAndSetGlobalGenerator(const std::string& name);
|
||||
|
||||
#ifndef CMAKE_BOOTSTRAP
|
||||
//! Print list of configure presets
|
||||
@ -274,8 +274,7 @@ public:
|
||||
void SetGlobalGenerator(std::unique_ptr<cmGlobalGenerator>);
|
||||
|
||||
//! Get the names of the current registered generators
|
||||
void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
|
||||
bool includeNamesWithPlatform = true) const;
|
||||
void GetRegisteredGenerators(std::vector<GeneratorInfo>& generators) const;
|
||||
|
||||
//! Set the name of the selected generator-specific instance.
|
||||
void SetGeneratorInstance(std::string const& instance)
|
||||
|
Loading…
Reference in New Issue
Block a user