diff options
author | Brad King <brad.king@kitware.com> | 2021-05-11 13:22:30 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-05-11 13:22:47 (GMT) |
commit | d0b6eb8ec7ac3eac10889ef50bb0c76cd308bde8 (patch) | |
tree | 047df76b209a54fd0ff28d1ae51d467241359b80 | |
parent | ad961fd42a595e877400aaecd3a47a973e9c6e89 (diff) | |
parent | 66be34853ce0046c132a5713d41e5c3608612bbf (diff) | |
download | CMake-d0b6eb8ec7ac3eac10889ef50bb0c76cd308bde8.zip CMake-d0b6eb8ec7ac3eac10889ef50bb0c76cd308bde8.tar.gz CMake-d0b6eb8ec7ac3eac10889ef50bb0c76cd308bde8.tar.bz2 |
Merge topic 'capabilties-generator-platforms'
66be34853c cmake: add supported platforms to cmake -E capabilties report
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6102
-rw-r--r-- | Help/manual/cmake.1.rst | 6 | ||||
-rw-r--r-- | Help/release/dev/capabilties-generator-platforms.rst | 6 | ||||
-rw-r--r-- | Source/cmake.cxx | 7 |
3 files changed, 19 insertions, 0 deletions
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 74c2a46..2d639b6 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 a08babe..278fcc1 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 { |