summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-02-01 16:52:07 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-02-02 17:43:13 (GMT)
commitf551f49a179e61d63b6a174ac35840525ed6dccd (patch)
treec58ab6564f4bc02e38f6c5500e8940efd043977e /Source/cmTarget.cxx
parentd1627118e74f99f0dc647fe779a5d0a186dda0d9 (diff)
downloadCMake-f551f49a179e61d63b6a174ac35840525ed6dccd.zip
CMake-f551f49a179e61d63b6a174ac35840525ed6dccd.tar.gz
CMake-f551f49a179e61d63b6a174ac35840525ed6dccd.tar.bz2
cmTarget: factor out properties for targets with exports
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9c90536..52c9508 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -305,6 +305,9 @@ struct TargetProperty
LinkableLibraryTarget,
// Needs to be an executable.
ExecutableTarget,
+ // Needs to be a target with meaningful symbol exports (`SHARED` or
+ // `EXECUTABLE`).
+ TargetWithSymbolExports,
};
enum class Repetition
@@ -458,6 +461,8 @@ TargetProperty const StaticTargetProperties[] = {
{ "INSTALL_RPATH"_s, ""_s, IC::CanCompileSources },
{ "INSTALL_RPATH_USE_LINK_PATH"_s, "OFF"_s, IC::CanCompileSources },
// -- Platforms
+ // ---- AIX
+ { "AIX_EXPORT_ALL_SYMBOLS"_s, IC::TargetWithSymbolExports },
// ---- Android
{ "ANDROID_GUI"_s, IC::ExecutableTarget },
{ "ANDROID_JAR_DIRECTORIES"_s, IC::CanCompileSources },
@@ -474,6 +479,7 @@ TargetProperty const StaticTargetProperties[] = {
// ---- Windows
{ "GNUtoMS"_s, IC::CanCompileSources },
{ "WIN32_EXECUTABLE"_s, IC::CanCompileSources },
+ { "WINDOWS_EXPORT_ALL_SYMBOLS"_s, IC::TargetWithSymbolExports },
// -- Languages
// ---- C
{ "C_LINKER_LAUNCHER"_s, IC::CanCompileSources },
@@ -973,11 +979,6 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
} else if (this->CanCompileSources()) {
initProp("POSITION_INDEPENDENT_CODE");
}
- if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
- this->impl->TargetType == cmStateEnums::EXECUTABLE) {
- initProp("AIX_EXPORT_ALL_SYMBOLS");
- initProp("WINDOWS_EXPORT_ALL_SYMBOLS");
- }
// Record current policies for later use.
this->impl->Makefile->RecordPolicies(this->impl->PolicyMap);
@@ -1033,6 +1034,11 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
if (this->impl->TargetType == cmStateEnums::EXECUTABLE) {
metConditions.insert(TargetProperty::InitCondition::ExecutableTarget);
}
+ if (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::EXECUTABLE) {
+ metConditions.insert(
+ TargetProperty::InitCondition::TargetWithSymbolExports);
+ }
std::vector<std::string> configNames =
mf->GetGeneratorConfigs(cmMakefile::ExcludeEmptyConfig);