mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
cmake: add supported platforms to cmake -E capabilties report
This commit is contained in:
@@ -575,6 +575,12 @@ Available commands are:
|
||||
``true`` if the generator supports toolsets and ``false`` otherwise.
|
||||
``platformSupport``
|
||||
``true`` if the generator supports platforms and ``false`` otherwise.
|
||||
``supportedPlatforms``
|
||||
.. versionadded:: 3.21
|
||||
|
||||
Optional member that may be present when the generator supports
|
||||
platform specification via :variable:`CMAKE_GENERATOR_PLATFORM`
|
||||
(``-A ...``). The value is a list of platforms known to be supported.
|
||||
``extraGenerators``
|
||||
A list of strings with all the extra generators compatible with
|
||||
the generator.
|
||||
|
6
Help/release/dev/capabilties-generator-platforms.rst
Normal file
6
Help/release/dev/capabilties-generator-platforms.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
capabilties-generator-platforms
|
||||
-------------------------------
|
||||
|
||||
* The :manual:`cmake(1)` ``-E capabilities`` output now contains for each
|
||||
generator a ``supportedPlatforms`` field listing platform known to
|
||||
be supported in :variable:`CMAKE_GENERATOR_PLATFORM`.
|
@@ -259,6 +259,13 @@ Json::Value cmake::ReportCapabilitiesJson() const
|
||||
gen["name"] = gi.name;
|
||||
gen["toolsetSupport"] = gi.supportsToolset;
|
||||
gen["platformSupport"] = gi.supportsPlatform;
|
||||
if (!gi.supportedPlatforms.empty()) {
|
||||
Json::Value supportedPlatforms = Json::arrayValue;
|
||||
for (std::string const& platform : gi.supportedPlatforms) {
|
||||
supportedPlatforms.append(platform);
|
||||
}
|
||||
gen["supportedPlatforms"] = std::move(supportedPlatforms);
|
||||
}
|
||||
gen["extraGenerators"] = Json::arrayValue;
|
||||
generatorMap[gi.name] = gen;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user