mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 05:50:42 +00:00
Add global generator factory method to get list of known platforms
Add a `cmGlobalGeneratorFactory::GetKnownPlatforms` method to return a list of known possible values for `CMAKE_GENERATOR_PLATFORM`. Implement the method for each generator by referencing the list of possible values documented in `Help/generator/*.rst` for it. Co-Author: Julien Jomier <julien.jomier@kitware.com>
This commit is contained in:
parent
8144b00e32
commit
818df52c48
@ -38,6 +38,9 @@ public:
|
|||||||
|
|
||||||
/** Determine whether or not this generator supports platforms */
|
/** Determine whether or not this generator supports platforms */
|
||||||
virtual bool SupportsPlatform() const = 0;
|
virtual bool SupportsPlatform() const = 0;
|
||||||
|
|
||||||
|
/** Get the list of supported platforms name for this generator */
|
||||||
|
virtual std::vector<std::string> GetKnownPlatforms() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
@ -77,6 +80,13 @@ public:
|
|||||||
|
|
||||||
/** Determine whether or not this generator supports platforms */
|
/** Determine whether or not this generator supports platforms */
|
||||||
bool SupportsPlatform() const override { return T::SupportsPlatform(); }
|
bool SupportsPlatform() const override { return T::SupportsPlatform(); }
|
||||||
|
|
||||||
|
/** Get the list of supported platforms name for this generator */
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
// default is no platform supported
|
||||||
|
return std::vector<std::string>();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -91,6 +91,15 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("Itanium");
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
|
cmGlobalGeneratorFactory* cmGlobalVisualStudio10Generator::NewFactory()
|
||||||
|
@ -93,6 +93,22 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("ARM");
|
||||||
|
|
||||||
|
std::set<std::string> installedSDKs =
|
||||||
|
cmGlobalVisualStudio11Generator::GetInstalledWindowsCESDKs();
|
||||||
|
for (std::string const& i : installedSDKs) {
|
||||||
|
platforms.emplace_back(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
|
cmGlobalGeneratorFactory* cmGlobalVisualStudio11Generator::NewFactory()
|
||||||
|
@ -75,6 +75,15 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("ARM");
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
|
cmGlobalGeneratorFactory* cmGlobalVisualStudio12Generator::NewFactory()
|
||||||
|
@ -75,6 +75,15 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("ARM");
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory()
|
cmGlobalGeneratorFactory* cmGlobalVisualStudio14Generator::NewFactory()
|
||||||
|
@ -83,6 +83,22 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return false; }
|
bool SupportsToolset() const override { return false; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("Itanium");
|
||||||
|
cmVisualStudioWCEPlatformParser parser;
|
||||||
|
parser.ParseVersion("9.0");
|
||||||
|
const std::vector<std::string>& availablePlatforms =
|
||||||
|
parser.GetAvailablePlatforms();
|
||||||
|
for (std::string const& i : availablePlatforms) {
|
||||||
|
platforms.emplace_back(i);
|
||||||
|
}
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
|
cmGlobalGeneratorFactory* cmGlobalVisualStudio9Generator::NewFactory()
|
||||||
|
@ -149,6 +149,16 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("ARM");
|
||||||
|
platforms.emplace_back("ARM64");
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory*
|
cmGlobalGeneratorFactory*
|
||||||
@ -214,6 +224,16 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return true; }
|
bool SupportsPlatform() const override { return true; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
std::vector<std::string> platforms;
|
||||||
|
platforms.emplace_back("x64");
|
||||||
|
platforms.emplace_back("Win32");
|
||||||
|
platforms.emplace_back("ARM");
|
||||||
|
platforms.emplace_back("ARM64");
|
||||||
|
return platforms;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalGeneratorFactory*
|
cmGlobalGeneratorFactory*
|
||||||
|
@ -147,6 +147,11 @@ public:
|
|||||||
|
|
||||||
bool SupportsToolset() const override { return true; }
|
bool SupportsToolset() const override { return true; }
|
||||||
bool SupportsPlatform() const override { return false; }
|
bool SupportsPlatform() const override { return false; }
|
||||||
|
|
||||||
|
std::vector<std::string> GetKnownPlatforms() const override
|
||||||
|
{
|
||||||
|
return std::vector<std::string>();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(
|
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(
|
||||||
|
@ -976,6 +976,7 @@ void cmake::GetRegisteredGenerators(std::vector<GeneratorInfo>& generators,
|
|||||||
GeneratorInfo info;
|
GeneratorInfo info;
|
||||||
info.supportsToolset = gen->SupportsToolset();
|
info.supportsToolset = gen->SupportsToolset();
|
||||||
info.supportsPlatform = gen->SupportsPlatform();
|
info.supportsPlatform = gen->SupportsPlatform();
|
||||||
|
info.supportedPlatforms = gen->GetKnownPlatforms();
|
||||||
info.name = name;
|
info.name = name;
|
||||||
info.baseName = name;
|
info.baseName = name;
|
||||||
info.isAlias = false;
|
info.isAlias = false;
|
||||||
|
@ -104,6 +104,7 @@ public:
|
|||||||
std::string extraName;
|
std::string extraName;
|
||||||
bool supportsToolset;
|
bool supportsToolset;
|
||||||
bool supportsPlatform;
|
bool supportsPlatform;
|
||||||
|
std::vector<std::string> supportedPlatforms;
|
||||||
bool isAlias;
|
bool isAlias;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user