diff --git a/Source/cmGlobalGeneratorFactory.h b/Source/cmGlobalGeneratorFactory.h index 906ec9acf76040ba843f5027f0efaf1f98caab0d..26c9545b21f1a0f229edc98b982e7a8a6f73c839 100644 --- a/Source/cmGlobalGeneratorFactory.h +++ b/Source/cmGlobalGeneratorFactory.h @@ -38,6 +38,9 @@ public: /** Determine whether or not this generator supports platforms */ 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> @@ -77,6 +80,13 @@ public: /** Determine whether or not this generator supports platforms */ 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 diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index bf856ead38bdd4f793b10e8507d24e8ac0d08add..c439f685afeac5948d075a681c27542e96bd8645 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -91,6 +91,15 @@ public: bool SupportsToolset() 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() diff --git a/Source/cmGlobalVisualStudio11Generator.cxx b/Source/cmGlobalVisualStudio11Generator.cxx index a44058b622cde4b08e5094914dd9475782a96551..0aaf2bb8503edb79a0dc11f00941966c7e5e791d 100644 --- a/Source/cmGlobalVisualStudio11Generator.cxx +++ b/Source/cmGlobalVisualStudio11Generator.cxx @@ -93,6 +93,22 @@ public: bool SupportsToolset() 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() diff --git a/Source/cmGlobalVisualStudio12Generator.cxx b/Source/cmGlobalVisualStudio12Generator.cxx index cbd5085be85c6472b2262dc15aeec5f8aa3d0f4f..1c202a897bd31f3d69d34ac9c79463c742cc7987 100644 --- a/Source/cmGlobalVisualStudio12Generator.cxx +++ b/Source/cmGlobalVisualStudio12Generator.cxx @@ -75,6 +75,15 @@ public: bool SupportsToolset() 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() diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx index 47768a886561681c84da2239b2784df894831ca1..c87433e8d405ed5a5c627e088c5e704e263b58ff 100644 --- a/Source/cmGlobalVisualStudio14Generator.cxx +++ b/Source/cmGlobalVisualStudio14Generator.cxx @@ -75,6 +75,15 @@ public: bool SupportsToolset() 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() diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index d72b25b4affe20af0c61b07db7b74974b27ef8f2..15a83afecaeabec44f5d8a6a84ea450e470aa807 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -83,6 +83,22 @@ public: bool SupportsToolset() const override { return false; } 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() diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx index 086029470bb15a2dab7c483568acd2667970f808..4b08b11ebe76e95bf85f74eed041850219b2461a 100644 --- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx +++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx @@ -149,6 +149,16 @@ public: bool SupportsToolset() 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* @@ -214,6 +224,16 @@ public: bool SupportsToolset() 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* diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index e5ab0e1b465af21578111ddbf563e432071d52a9..ca5dafe69bba55803db3ad75880b664f2c038955 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -147,6 +147,11 @@ public: bool SupportsToolset() const override { return true; } bool SupportsPlatform() const override { return false; } + + std::vector<std::string> GetKnownPlatforms() const override + { + return std::vector<std::string>(); + } }; cmGlobalXCodeGenerator::cmGlobalXCodeGenerator( diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f320aff75f258f10ccb0250a01021a9158f94dc8..927d39b6ca07514bb4d5f834ac43e8c7ef765e9d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -976,6 +976,7 @@ void cmake::GetRegisteredGenerators(std::vector<GeneratorInfo>& generators, GeneratorInfo info; info.supportsToolset = gen->SupportsToolset(); info.supportsPlatform = gen->SupportsPlatform(); + info.supportedPlatforms = gen->GetKnownPlatforms(); info.name = name; info.baseName = name; info.isAlias = false; diff --git a/Source/cmake.h b/Source/cmake.h index b37cccd96f00c1ce0bfab69d54de3600cdf298b2..d67f8356d6b6aac268ff3101aec33e5968e35cb2 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -104,6 +104,7 @@ public: std::string extraName; bool supportsToolset; bool supportsPlatform; + std::vector<std::string> supportedPlatforms; bool isAlias; };