From 3cbc15773fc12c96597d56f1f27106fa228328c8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 19 Jul 2019 10:29:02 -0400 Subject: cmGeneratorTarget: Move static functions to anonymous namespace --- Source/cmGeneratorTarget.cxx | 69 +++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index aa1f8d1..da16788 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -651,12 +651,14 @@ std::vector const* cmGeneratorTarget::GetSourceDepends( return nullptr; } -static void handleSystemIncludesDep( - cmLocalGenerator* lg, cmGeneratorTarget const* depTgt, - const std::string& config, cmGeneratorTarget const* headTarget, - cmGeneratorExpressionDAGChecker* dagChecker, - std::vector& result, bool excludeImported, - std::string const& language) +namespace { +void handleSystemIncludesDep(cmLocalGenerator* lg, + cmGeneratorTarget const* depTgt, + const std::string& config, + cmGeneratorTarget const* headTarget, + cmGeneratorExpressionDAGChecker* dagChecker, + std::vector& result, + bool excludeImported, std::string const& language) { if (const char* dirs = depTgt->GetProperty("INTERFACE_SYSTEM_INCLUDE_DIRECTORIES")) { @@ -679,6 +681,7 @@ static void handleSystemIncludesDep( result); } } +} /* clang-format off */ #define IMPLEMENT_VISIT(KIND) \ @@ -1081,7 +1084,8 @@ bool cmGeneratorTarget::GetPropertyAsBool(const std::string& prop) const return this->Target->GetPropertyAsBool(prop); } -static void AddInterfaceEntries( +namespace { +void AddInterfaceEntries( cmGeneratorTarget const* thisTarget, std::string const& config, std::string const& prop, std::vector& entries) @@ -1104,7 +1108,7 @@ static void AddInterfaceEntries( } } -static void AddObjectEntries( +void AddObjectEntries( cmGeneratorTarget const* thisTarget, std::string const& config, std::vector& entries) { @@ -1126,7 +1130,7 @@ static void AddObjectEntries( } } -static bool processSources( +bool processSources( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& srcs, @@ -1199,6 +1203,7 @@ static bool processSources( } return contextDependent; } +} std::vector> cmGeneratorTarget::GetSourceFilePaths( std::string const& config) const @@ -1853,16 +1858,17 @@ std::string cmGeneratorTarget::GetSOName(const std::string& config) const return this->GetLibraryNames(config).SharedObject; } -static bool shouldAddFullLevel(cmGeneratorTarget::BundleDirectoryLevel level) +namespace { +bool shouldAddFullLevel(cmGeneratorTarget::BundleDirectoryLevel level) { return level == cmGeneratorTarget::FullLevel; } -static bool shouldAddContentLevel( - cmGeneratorTarget::BundleDirectoryLevel level) +bool shouldAddContentLevel(cmGeneratorTarget::BundleDirectoryLevel level) { return level == cmGeneratorTarget::ContentLevel || shouldAddFullLevel(level); } +} std::string cmGeneratorTarget::GetAppBundleDirectory( const std::string& config, BundleDirectoryLevel level) const @@ -2765,7 +2771,9 @@ std::string cmGeneratorTarget::GetCreateRuleVariable( } return ""; } -static void processIncludeDirectories( + +namespace { +void processIncludeDirectories( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& includes, @@ -2874,6 +2882,7 @@ static void processIncludeDirectories( } } } +} std::vector> cmGeneratorTarget::GetIncludeDirectories( const std::string& config, const std::string& lang) const @@ -2942,7 +2951,8 @@ enum class OptionsParse Shell }; -static void processOptionsInternal( +namespace { +void processOptionsInternal( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -2985,7 +2995,7 @@ static void processOptionsInternal( } } -static void processCompileOptions( +void processCompileOptions( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -2997,6 +3007,7 @@ static void processCompileOptions( config, debugOptions, "compile options", language, OptionsParse::Shell); } +} void cmGeneratorTarget::GetCompileOptions(std::vector& result, const std::string& config, @@ -3051,7 +3062,8 @@ std::vector> cmGeneratorTarget::GetCompileOptions( return result; } -static void processCompileFeatures( +namespace { +void processCompileFeatures( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -3063,6 +3075,7 @@ static void processCompileFeatures( config, debugOptions, "compile features", std::string(), OptionsParse::None); } +} void cmGeneratorTarget::GetCompileFeatures(std::vector& result, const std::string& config) const @@ -3113,7 +3126,8 @@ std::vector> cmGeneratorTarget::GetCompileFeatures( return result; } -static void processCompileDefinitions( +namespace { +void processCompileDefinitions( cmGeneratorTarget const* tgt, const std::vector& entries, std::vector>& options, @@ -3125,6 +3139,7 @@ static void processCompileDefinitions( config, debugOptions, "compile definitions", language, OptionsParse::None); } +} void cmGeneratorTarget::GetCompileDefinitions( std::vector& result, const std::string& config, @@ -4343,8 +4358,9 @@ void checkPropertyConsistency(cmGeneratorTarget const* depender, } } -static std::string intersect(const std::set& s1, - const std::set& s2) +namespace { +std::string intersect(const std::set& s1, + const std::set& s2) { std::set intersect; std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), @@ -4355,9 +4371,9 @@ static std::string intersect(const std::set& s1, return ""; } -static std::string intersect(const std::set& s1, - const std::set& s2, - const std::set& s3) +std::string intersect(const std::set& s1, + const std::set& s2, + const std::set& s3) { std::string result; result = intersect(s1, s2); @@ -4371,10 +4387,10 @@ static std::string intersect(const std::set& s1, return intersect(s2, s3); } -static std::string intersect(const std::set& s1, - const std::set& s2, - const std::set& s3, - const std::set& s4) +std::string intersect(const std::set& s1, + const std::set& s2, + const std::set& s3, + const std::set& s4) { std::string result; result = intersect(s1, s2); @@ -4391,6 +4407,7 @@ static std::string intersect(const std::set& s1, } return intersect(s2, s3, s4); } +} void cmGeneratorTarget::CheckPropertyCompatibility( cmComputeLinkInformation* info, const std::string& config) const -- cgit v0.12