summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorscheffle <scheffle@users.noreply.github.com>2021-05-07 13:28:29 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-10 14:28:28 (GMT)
commit66be34853ce0046c132a5713d41e5c3608612bbf (patch)
treeb7b4347aee9fb7247ee8a44d9ec5415df29b6df9
parenteac20afe9af631fbc7ea1b172e066875895077ce (diff)
downloadCMake-66be34853ce0046c132a5713d41e5c3608612bbf.zip
CMake-66be34853ce0046c132a5713d41e5c3608612bbf.tar.gz
CMake-66be34853ce0046c132a5713d41e5c3608612bbf.tar.bz2
cmake: add supported platforms to cmake -E capabilties report
-rw-r--r--Help/manual/cmake.1.rst6
-rw-r--r--Help/release/dev/capabilties-generator-platforms.rst6
-rw-r--r--Source/cmake.cxx7
3 files changed, 19 insertions, 0 deletions
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst
index f416f86..55e01e1 100644
--- a/Help/manual/cmake.1.rst
+++ b/Help/manual/cmake.1.rst
@@ -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.
diff --git a/Help/release/dev/capabilties-generator-platforms.rst b/Help/release/dev/capabilties-generator-platforms.rst
new file mode 100644
index 0000000..5de2b67
--- /dev/null
+++ b/Help/release/dev/capabilties-generator-platforms.rst
@@ -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`.
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 4130f5f..0eede0a 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -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 {