diff options
author | Brad King <brad.king@kitware.com> | 2024-09-18 17:58:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-09-20 17:45:46 (GMT) |
commit | 3bd73fcc76576b0e0656ca8ba73402d102a1ee30 (patch) | |
tree | f4742e05035ff34ed6dbb614c1693ed788fd587d /Source | |
parent | 8db69c767bb2cf85abc20333be04ae758f11c89d (diff) | |
download | CMake-3bd73fcc76576b0e0656ca8ba73402d102a1ee30.zip CMake-3bd73fcc76576b0e0656ca8ba73402d102a1ee30.tar.gz CMake-3bd73fcc76576b0e0656ca8ba73402d102a1ee30.tar.bz2 |
cmComputeLinkDepends: Modernize member initialization
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkDepends.cxx | 33 | ||||
-rw-r--r-- | Source/cmComputeLinkDepends.h | 15 |
2 files changed, 18 insertions, 30 deletions
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 9ff6d70..1e3b7e9 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -580,15 +580,17 @@ std::string const& cmComputeLinkDepends::LinkEntry::DEFAULT = cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, const std::string& config, const std::string& linkLanguage) -{ - // Store context information. - this->Target = target; - this->Makefile = this->Target->Target->GetMakefile(); - this->GlobalGenerator = - this->Target->GetLocalGenerator()->GetGlobalGenerator(); - this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); - this->LinkLanguage = linkLanguage; + : Target(target) + , Makefile(this->Target->Target->GetMakefile()) + , GlobalGenerator(this->Target->GetLocalGenerator()->GetGlobalGenerator()) + , CMakeInstance(this->GlobalGenerator->GetCMakeInstance()) + , Config(config) + , DebugMode(this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE")) + , LinkLanguage(linkLanguage) + , LinkType(CMP0003_ComputeLinkType( + this->Config, this->Makefile->GetCMakeInstance()->GetDebugConfigs())) +{ // target oriented feature override property takes precedence over // global override property cm::string_view lloPrefix = "LINK_LIBRARY_OVERRIDE_"_s; @@ -640,21 +642,6 @@ cmComputeLinkDepends::cmComputeLinkDepends(const cmGeneratorTarget* target, }); } } - - // The configuration being linked. - this->Config = config; - std::vector<std::string> debugConfigs = - this->Makefile->GetCMakeInstance()->GetDebugConfigs(); - this->LinkType = CMP0003_ComputeLinkType(this->Config, debugConfigs); - - // Enable debug mode if requested. - this->DebugMode = this->Makefile->IsOn("CMAKE_LINK_DEPENDS_DEBUG_MODE"); - - // Assume no compatibility until set. - this->OldLinkDirMode = false; - - // No computation has been done. - this->CCG = nullptr; } cmComputeLinkDepends::~cmComputeLinkDepends() = default; diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index d51d548..5926c12 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -86,12 +86,15 @@ public: private: // Context information. - cmGeneratorTarget const* Target; - cmMakefile* Makefile; - cmGlobalGenerator const* GlobalGenerator; + cmGeneratorTarget const* Target = nullptr; + cmMakefile* Makefile = nullptr; + cmGlobalGenerator const* GlobalGenerator = nullptr; cmake* CMakeInstance; - std::string LinkLanguage; std::string Config; + bool DebugMode = false; + std::string LinkLanguage; + cmTargetLinkLibraryType LinkType; + EntryVector FinalLinkEntries; std::map<std::string, std::string> LinkLibraryOverride; @@ -207,7 +210,5 @@ private: std::vector<size_t> ObjectEntries; size_t ComponentOrderId; - cmTargetLinkLibraryType LinkType; - bool DebugMode; - bool OldLinkDirMode; + bool OldLinkDirMode = false; }; |