summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-03-23 13:57:09 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2019-03-23 14:04:56 (GMT)
commitfa8e2dfc7b10066b2ba575c20ea96d802109e6c3 (patch)
tree647eb7596633aa081c6a06046b674e84834fd453 /Source/cmTarget.cxx
parentc9bd2e941f106c4c23bb2bb2623991251b528aa5 (diff)
downloadCMake-fa8e2dfc7b10066b2ba575c20ea96d802109e6c3.zip
CMake-fa8e2dfc7b10066b2ba575c20ea96d802109e6c3.tar.gz
CMake-fa8e2dfc7b10066b2ba575c20ea96d802109e6c3.tar.bz2
cmTarget: Move member `TargetType` to impl
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx32
1 files changed, 19 insertions, 13 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9e2f88c..14f860f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -164,6 +164,7 @@ const char* cmTargetPropertyComputer::GetSources<cmTarget>(
class cmTargetInternals
{
public:
+ cmStateEnums::TargetType TargetType;
std::vector<std::string> IncludeDirectoriesEntries;
std::vector<cmListFileBacktrace> IncludeDirectoriesBacktraces;
std::vector<std::string> CompileOptionsEntries;
@@ -186,9 +187,9 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
Visibility vis, cmMakefile* mf)
{
assert(mf);
+ impl->TargetType = type;
this->IsGeneratorProvided = false;
this->Name = name;
- this->TargetTypeValue = type;
this->Makefile = mf;
this->HaveInstallRule = false;
this->DLLPlatform = false;
@@ -333,7 +334,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
for (auto const& prop : configProps) {
// Interface libraries have no output locations, so honor only
// the configuration map.
- if (this->TargetTypeValue == cmStateEnums::INTERFACE_LIBRARY &&
+ if (impl->TargetType == cmStateEnums::INTERFACE_LIBRARY &&
strcmp(prop, "MAP_IMPORTED_CONFIG_") != 0) {
continue;
}
@@ -347,8 +348,8 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
// compatibility with previous CMake versions in which executables
// did not support this variable. Projects may still specify the
// property directly.
- if (this->TargetTypeValue != cmStateEnums::EXECUTABLE &&
- this->TargetTypeValue != cmStateEnums::INTERFACE_LIBRARY) {
+ if (impl->TargetType != cmStateEnums::EXECUTABLE &&
+ impl->TargetType != cmStateEnums::INTERFACE_LIBRARY) {
std::string property = cmSystemTools::UpperCase(configName);
property += "_POSTFIX";
this->SetPropertyDefault(property, nullptr);
@@ -395,17 +396,17 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("VISIBILITY_INLINES_HIDDEN", nullptr);
}
- if (this->TargetTypeValue == cmStateEnums::EXECUTABLE) {
+ if (impl->TargetType == cmStateEnums::EXECUTABLE) {
this->SetPropertyDefault("ANDROID_GUI", nullptr);
this->SetPropertyDefault("CROSSCOMPILING_EMULATOR", nullptr);
this->SetPropertyDefault("ENABLE_EXPORTS", nullptr);
}
- if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY ||
- this->TargetTypeValue == cmStateEnums::MODULE_LIBRARY) {
+ if (impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ impl->TargetType == cmStateEnums::MODULE_LIBRARY) {
this->SetProperty("POSITION_INDEPENDENT_CODE", "True");
}
- if (this->TargetTypeValue == cmStateEnums::SHARED_LIBRARY ||
- this->TargetTypeValue == cmStateEnums::EXECUTABLE) {
+ if (impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ impl->TargetType == cmStateEnums::EXECUTABLE) {
this->SetPropertyDefault("WINDOWS_EXPORT_ALL_SYMBOLS", nullptr);
}
@@ -417,7 +418,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
// Record current policies for later use.
this->Makefile->RecordPolicies(this->PolicyMap);
- if (this->TargetTypeValue == cmStateEnums::INTERFACE_LIBRARY) {
+ if (impl->TargetType == cmStateEnums::INTERFACE_LIBRARY) {
// This policy is checked in a few conditions. The properties relevant
// to the policy are always ignored for cmStateEnums::INTERFACE_LIBRARY
// targets,
@@ -431,7 +432,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
this->SetPropertyDefault("JOB_POOL_LINK", nullptr);
}
- if (this->TargetTypeValue <= cmStateEnums::UTILITY) {
+ if (impl->TargetType <= cmStateEnums::UTILITY) {
this->SetPropertyDefault("DOTNET_TARGET_FRAMEWORK_VERSION", nullptr);
}
@@ -461,6 +462,11 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type,
}
}
+cmStateEnums::TargetType cmTarget::GetType() const
+{
+ return impl->TargetType;
+}
+
cmGlobalGenerator* cmTarget::GetGlobalGenerator() const
{
return this->GetMakefile()->GetGlobalGenerator();
@@ -772,8 +778,8 @@ void cmTarget::AddLinkLibrary(cmMakefile& mf, std::string const& lib,
// may be purposefully duplicated to handle recursive dependencies,
// and we removing one instance will break the link line. Duplicates
// will be appropriately eliminated at emit time.
- if (this->TargetTypeValue >= cmStateEnums::STATIC_LIBRARY &&
- this->TargetTypeValue <= cmStateEnums::MODULE_LIBRARY &&
+ if (impl->TargetType >= cmStateEnums::STATIC_LIBRARY &&
+ impl->TargetType <= cmStateEnums::MODULE_LIBRARY &&
(this->GetPolicyStatusCMP0073() == cmPolicies::OLD ||
this->GetPolicyStatusCMP0073() == cmPolicies::WARN)) {
std::string targetEntry = this->Name;