diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-23 13:57:09 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-03-23 14:04:56 (GMT) |
commit | fa8e2dfc7b10066b2ba575c20ea96d802109e6c3 (patch) | |
tree | 647eb7596633aa081c6a06046b674e84834fd453 | |
parent | c9bd2e941f106c4c23bb2bb2623991251b528aa5 (diff) | |
download | CMake-fa8e2dfc7b10066b2ba575c20ea96d802109e6c3.zip CMake-fa8e2dfc7b10066b2ba575c20ea96d802109e6c3.tar.gz CMake-fa8e2dfc7b10066b2ba575c20ea96d802109e6c3.tar.bz2 |
cmTarget: Move member `TargetType` to impl
-rw-r--r-- | Source/cmTarget.cxx | 32 | ||||
-rw-r--r-- | Source/cmTarget.h | 7 |
2 files changed, 21 insertions, 18 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; diff --git a/Source/cmTarget.h b/Source/cmTarget.h index 0701661..d18acef 100644 --- a/Source/cmTarget.h +++ b/Source/cmTarget.h @@ -66,10 +66,8 @@ public: POST_BUILD }; - /** - * Return the type of target. - */ - cmStateEnums::TargetType GetType() const { return this->TargetTypeValue; } + ///! Return the type of target. + cmStateEnums::TargetType GetType() const; cmGlobalGenerator* GetGlobalGenerator() const; @@ -320,7 +318,6 @@ private: LinkLibraryVectorType OriginalLinkLibraries; cmMakefile* Makefile; cmTargetInternalPointer impl; - cmStateEnums::TargetType TargetTypeValue; bool HaveInstallRule; bool DLLPlatform; bool IsAndroid; |