diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-01 16:38:19 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2023-02-02 17:43:13 (GMT) |
commit | 8004fe3f14aeafdc5ab6b9b8b6e23932d0252b32 (patch) | |
tree | 15b7c76ad891c63c8d3a7c2a0bc4909736f0d11a /Source/cmTarget.cxx | |
parent | e522f8ca069fc67d83ed9eba27a3afa41201613c (diff) | |
download | CMake-8004fe3f14aeafdc5ab6b9b8b6e23932d0252b32.zip CMake-8004fe3f14aeafdc5ab6b9b8b6e23932d0252b32.tar.gz CMake-8004fe3f14aeafdc5ab6b9b8b6e23932d0252b32.tar.bz2 |
cmTarget: factor out Xcode-requiring properties
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r-- | Source/cmTarget.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9cfdee3..57b5850 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -284,6 +284,8 @@ struct TargetProperty Never, // Only initialize if the target can compile sources. CanCompileSources, + // Only apply to Xcode generators. + NeedsXcode, }; enum class Repetition @@ -521,6 +523,9 @@ TargetProperty const StaticTargetProperties[] = { // Metadata { "EXPORT_COMPILE_COMMANDS"_s, IC::CanCompileSources }, { "FOLDER"_s }, + + // Xcode properties + { "XCODE_GENERATE_SCHEME"_s, IC::NeedsXcode }, /* clang-format on */ }; @@ -909,10 +914,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, #endif } - if (this->GetGlobalGenerator()->IsXcode()) { - initProp("XCODE_GENERATE_SCHEME"); - } - // Setup per-configuration property default values. if (this->GetType() != cmStateEnums::UTILITY && this->GetType() != cmStateEnums::GLOBAL_TARGET) { @@ -1028,6 +1029,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, if (this->CanCompileSources()) { metConditions.insert(TargetProperty::InitCondition::CanCompileSources); } + if (this->GetGlobalGenerator()->IsXcode()) { + metConditions.insert(TargetProperty::InitCondition::NeedsXcode); + } std::vector<std::string> configNames = mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig); |