| 383 | } |
| 384 | |
| 385 | Json::Value cmake::ReportCapabilitiesJson() const |
| 386 | { |
| 387 | Json::Value obj = Json::objectValue; |
| 388 | |
| 389 | // Version information: |
| 390 | obj["version"] = this->ReportVersionJson(); |
| 391 | |
| 392 | // Generators: |
| 393 | std::vector<cmake::GeneratorInfo> generatorInfoList; |
| 394 | this->GetRegisteredGenerators(generatorInfoList); |
| 395 | |
| 396 | auto* curlVersion = curl_version_info(CURLVERSION_FIRST); |
| 397 | |
| 398 | JsonValueMapType generatorMap; |
| 399 | for (cmake::GeneratorInfo const& gi : generatorInfoList) { |
| 400 | if (gi.isAlias) { // skip aliases, they are there for compatibility reasons |
| 401 | // only |
| 402 | continue; |
| 403 | } |
| 404 | |
| 405 | if (gi.extraName.empty()) { |
| 406 | Json::Value gen = Json::objectValue; |
| 407 | gen["name"] = gi.name; |
| 408 | gen["toolsetSupport"] = gi.supportsToolset; |
| 409 | gen["platformSupport"] = gi.supportsPlatform; |
| 410 | if (!gi.supportedPlatforms.empty()) { |
| 411 | Json::Value supportedPlatforms = Json::arrayValue; |
| 412 | for (std::string const& platform : gi.supportedPlatforms) { |
| 413 | supportedPlatforms.append(platform); |
| 414 | } |
| 415 | gen["supportedPlatforms"] = std::move(supportedPlatforms); |
| 416 | } |
| 417 | gen["extraGenerators"] = Json::arrayValue; |
| 418 | generatorMap[gi.name] = gen; |
| 419 | } else { |
| 420 | Json::Value& gen = generatorMap[gi.baseName]; |
| 421 | gen["extraGenerators"].append(gi.extraName); |
| 422 | } |
| 423 | } |
| 424 | |
| 425 | Json::Value generators = Json::arrayValue; |
| 426 | for (auto const& i : generatorMap) { |
| 427 | generators.append(i.second); |
| 428 | } |
| 429 | obj["generators"] = generators; |
| 430 | obj["fileApi"] = cmFileAPI::ReportCapabilities(); |
| 431 | obj["serverMode"] = false; |
| 432 | obj["tls"] = static_cast<bool>(curlVersion->features & CURL_VERSION_SSL); |
| 433 | # ifdef CMake_ENABLE_DEBUGGER |
| 434 | obj["debugger"] = true; |
| 435 | # else |
| 436 | obj["debugger"] = false; |
| 437 | # endif |
| 438 | |
| 439 | return obj; |
| 440 | } |
| 441 | #endif |
| 442 |
no test coverage detected