1
0
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:
scheffle
2021-05-07 15:28:29 +02:00
committed by Brad King
parent eac20afe9a
commit 66be34853c
3 changed files with 19 additions and 0 deletions

View File

@@ -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.

View 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`.

View File

@@ -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 {