diff options
-rw-r--r-- | Help/manual/cmake.1.rst | 5 | ||||
-rw-r--r-- | Help/release/dev/E-capabilities-tls.rst | 5 | ||||
-rw-r--r-- | Source/cmake.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CommandLine/E_capabilities-stdout.txt | 2 |
4 files changed, 15 insertions, 1 deletions
diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 8cec9d4..2c86299 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -773,6 +773,11 @@ Available commands are: ``true`` if cmake supports server-mode and ``false`` otherwise. Always false since CMake 3.20. + ``tls`` + .. versionadded:: 3.25 + + ``true`` if TLS support is enabled and ``false`` otherwise. + .. option:: cat [--] <files>... .. versionadded:: 3.18 diff --git a/Help/release/dev/E-capabilities-tls.rst b/Help/release/dev/E-capabilities-tls.rst new file mode 100644 index 0000000..e2324d2 --- /dev/null +++ b/Help/release/dev/E-capabilities-tls.rst @@ -0,0 +1,5 @@ +E-capabilities-tls +------------------ + +* The :manual:`cmake -E capabilities <cmake(1)>` command gained a new ``tls`` + field that tells whether or not TLS is enabled. diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 9b2b119..8125227 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -63,6 +63,7 @@ #if !defined(CMAKE_BOOTSTRAP) # include <unordered_map> +# include <cm3p/curl/curl.h> # include <cm3p/json/writer.h> # include "cmFileAPI.h" @@ -252,6 +253,8 @@ Json::Value cmake::ReportCapabilitiesJson() const std::vector<cmake::GeneratorInfo> generatorInfoList; this->GetRegisteredGenerators(generatorInfoList); + auto* curlVersion = curl_version_info(CURLVERSION_FIRST); + JsonValueMapType generatorMap; for (cmake::GeneratorInfo const& gi : generatorInfoList) { if (gi.isAlias) { // skip aliases, they are there for compatibility reasons @@ -286,6 +289,7 @@ Json::Value cmake::ReportCapabilitiesJson() const obj["generators"] = generators; obj["fileApi"] = cmFileAPI::ReportCapabilities(); obj["serverMode"] = false; + obj["tls"] = static_cast<bool>(curlVersion->features & CURL_VERSION_SSL); return obj; } diff --git a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt index 6a932f1..1452c9b 100644 --- a/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt +++ b/Tests/RunCMake/CommandLine/E_capabilities-stdout.txt @@ -1 +1 @@ -^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":4}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"version":{.*}}$ +^{"fileApi":{"requests":\[{"kind":"codemodel","version":\[{"major":2,"minor":4}]},{"kind":"cache","version":\[{"major":2,"minor":0}]},{"kind":"cmakeFiles","version":\[{"major":1,"minor":0}]},{"kind":"toolchains","version":\[{"major":1,"minor":0}]}]},"generators":\[.*\],"serverMode":false,"tls":(true|false),"version":{.*}}$ |