MCPcopy Create free account
hub / github.com/Kitware/CMake / ProcessGeneratorToolsetField

Method ProcessGeneratorToolsetField

Source/cmGlobalXCodeGenerator.cxx:444–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444bool cmGlobalXCodeGenerator::ProcessGeneratorToolsetField(
445 std::string const& key, std::string const& value, cmMakefile* mf)
446{
447 if (key == "buildsystem"_s) {
448 if (value == "1"_s) {
449 this->XcodeBuildSystem = BuildSystem::One;
450 } else if (value == "12"_s) {
451 this->XcodeBuildSystem = BuildSystem::Twelve;
452 } else {
453 /* clang-format off */
454 std::string const& e = cmStrCat(
455 "Generator\n"
456 " ", this->GetName(), "\n"
457 "toolset specification field\n"
458 " buildsystem=", value, "\n"
459 "value is unknown. It must be '1' or '12'."
460 );
461 /* clang-format on */
462 mf->IssueMessage(MessageType::FATAL_ERROR, e);
463 return false;
464 }
465 if ((this->XcodeBuildSystem == BuildSystem::Twelve &&
466 this->XcodeVersion < 120) ||
467 (this->XcodeBuildSystem == BuildSystem::One &&
468 this->XcodeVersion >= 140)) {
469 /* clang-format off */
470 std::string const& e = cmStrCat(
471 "Generator\n"
472 " ", this->GetName(), "\n"
473 "toolset specification field\n"
474 " buildsystem=", value, "\n"
475 "is not allowed with Xcode ", this->VersionString, '.'
476 );
477 /* clang-format on */
478 mf->IssueMessage(MessageType::FATAL_ERROR, e);
479 return false;
480 }
481 return true;
482 }
483 /* clang-format off */
484 std::string const& e = cmStrCat(
485 "Generator\n"
486 " ", this->GetName(), "\n"
487 "given toolset specification that contains invalid field '", key, "'."
488 );
489 /* clang-format on */
490 mf->IssueMessage(MessageType::FATAL_ERROR, e);
491 return false;
492}
493
494bool cmGlobalXCodeGenerator::ParseKnownAttributes(
495 cm::string_view attribute, cm::string_view attributeValue)

Callers 1

ParseGeneratorToolsetMethod · 0.95

Calls 3

GetNameMethod · 0.95
cmStrCatFunction · 0.70
IssueMessageMethod · 0.45

Tested by

no test coverage detected