mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-01 03:29:18 -05:00
cmTarget: factor out properties with targets with commands
This commit is contained in:
+8
-5
@@ -308,6 +308,9 @@ struct TargetProperty
|
|||||||
// Needs to be a target with meaningful symbol exports (`SHARED` or
|
// Needs to be a target with meaningful symbol exports (`SHARED` or
|
||||||
// `EXECUTABLE`).
|
// `EXECUTABLE`).
|
||||||
TargetWithSymbolExports,
|
TargetWithSymbolExports,
|
||||||
|
// Targets with "commands" associated with them. Basically everything
|
||||||
|
// except global and `INTERFACE` targets.
|
||||||
|
TargetWithCommands,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class Repetition
|
enum class Repetition
|
||||||
@@ -398,6 +401,8 @@ TargetProperty const StaticTargetProperties[] = {
|
|||||||
COMMON_LANGUAGE_PROPERTIES(CXX),
|
COMMON_LANGUAGE_PROPERTIES(CXX),
|
||||||
// ---- CSharp
|
// ---- CSharp
|
||||||
{ "DOTNET_SDK"_s, IC::NonImportedTarget },
|
{ "DOTNET_SDK"_s, IC::NonImportedTarget },
|
||||||
|
{ "DOTNET_TARGET_FRAMEWORK"_s, IC::TargetWithCommands },
|
||||||
|
{ "DOTNET_TARGET_FRAMEWORK_VERSION"_s, IC::TargetWithCommands },
|
||||||
// ---- CUDA
|
// ---- CUDA
|
||||||
COMMON_LANGUAGE_PROPERTIES(CUDA),
|
COMMON_LANGUAGE_PROPERTIES(CUDA),
|
||||||
{ "CUDA_SEPARABLE_COMPILATION"_s, IC::CanCompileSources },
|
{ "CUDA_SEPARABLE_COMPILATION"_s, IC::CanCompileSources },
|
||||||
@@ -991,11 +996,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
|||||||
this->impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
|
this->impl->PolicyMap.Set(cmPolicies::CMP0022, cmPolicies::NEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->impl->TargetType <= cmStateEnums::GLOBAL_TARGET) {
|
|
||||||
initProp("DOTNET_TARGET_FRAMEWORK");
|
|
||||||
initProp("DOTNET_TARGET_FRAMEWORK_VERSION");
|
|
||||||
}
|
|
||||||
|
|
||||||
std::set<TargetProperty::InitCondition> metConditions;
|
std::set<TargetProperty::InitCondition> metConditions;
|
||||||
metConditions.insert(TargetProperty::InitCondition::Always);
|
metConditions.insert(TargetProperty::InitCondition::Always);
|
||||||
if (this->CanCompileSources()) {
|
if (this->CanCompileSources()) {
|
||||||
@@ -1039,6 +1039,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
|
|||||||
metConditions.insert(
|
metConditions.insert(
|
||||||
TargetProperty::InitCondition::TargetWithSymbolExports);
|
TargetProperty::InitCondition::TargetWithSymbolExports);
|
||||||
}
|
}
|
||||||
|
if (this->impl->TargetType <= cmStateEnums::GLOBAL_TARGET) {
|
||||||
|
metConditions.insert(TargetProperty::InitCondition::TargetWithCommands);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<std::string> configNames =
|
std::vector<std::string> configNames =
|
||||||
mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
|
mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);
|
||||||
|
|||||||
Reference in New Issue
Block a user