summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-02-01 16:44:54 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-02-02 17:43:13 (GMT)
commit92a4b21ac918ba6cf820b0289b4d26aa625f7805 (patch)
treedae0f0d5d2baa7442151c05e5b1eee8c925cc1e6 /Source
parent7a34637c3d90a26511aedb8daa47ca348bffefca (diff)
downloadCMake-92a4b21ac918ba6cf820b0289b4d26aa625f7805.zip
CMake-92a4b21ac918ba6cf820b0289b4d26aa625f7805.tar.gz
CMake-92a4b21ac918ba6cf820b0289b4d26aa625f7805.tar.bz2
cmTarget: factor out non-imported target properties
Diffstat (limited to 'Source')
-rw-r--r--Source/cmTarget.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index dfab17b..e74d8e8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -290,6 +290,8 @@ struct TargetProperty
NeedsXcodeAndCanCompileSources,
// Needs to be a "normal" target (any non-global, non-utility target).
NormalTarget,
+ // Any non-imported target.
+ NonImportedTarget,
};
enum class Repetition
@@ -377,6 +379,8 @@ TargetProperty const StaticTargetProperties[] = {
COMMON_LANGUAGE_PROPERTIES(C),
// ---- C++
COMMON_LANGUAGE_PROPERTIES(CXX),
+ // ---- CSharp
+ { "DOTNET_SDK"_s, IC::NonImportedTarget },
// ---- CUDA
COMMON_LANGUAGE_PROPERTIES(CUDA),
{ "CUDA_SEPARABLE_COMPILATION"_s, IC::CanCompileSources },
@@ -1016,10 +1020,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
}
- if (!this->IsImported()) {
- initProp("DOTNET_SDK");
- }
-
if (this->impl->TargetType <= cmStateEnums::GLOBAL_TARGET) {
initProp("DOTNET_TARGET_FRAMEWORK");
initProp("DOTNET_TARGET_FRAMEWORK_VERSION");
@@ -1037,6 +1037,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
TargetProperty::InitCondition::NeedsXcodeAndCanCompileSources);
}
}
+ if (!this->IsImported()) {
+ metConditions.insert(TargetProperty::InitCondition::NonImportedTarget);
+ }
if (this->impl->TargetType != cmStateEnums::UTILITY &&
this->impl->TargetType != cmStateEnums::GLOBAL_TARGET) {
metConditions.insert(TargetProperty::InitCondition::NormalTarget);