diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 13:42:15 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-25 18:24:45 (GMT) |
commit | a133a583d484028f8b03bd791ebea8ba0cf96b84 (patch) | |
tree | 0674b75f633c0785f8b095b3606f84a6e87ba103 /Source/cmNinjaTargetGenerator.cxx | |
parent | c99db7153337865861ccb79c8f855d4d9f3539fc (diff) | |
download | CMake-a133a583d484028f8b03bd791ebea8ba0cf96b84.zip CMake-a133a583d484028f8b03bd791ebea8ba0cf96b84.tar.gz CMake-a133a583d484028f8b03bd791ebea8ba0cf96b84.tar.bz2 |
cmLocalGenerator: Clarify GetIncludeFlags signature
Make the `config` argument non-optional so all callers must be explicit.
Convert the path style argument to an enumeration to make its role clear
at call sites.
The path style argument is implemented by `ConvertToIncludeReference`,
which was introduced with the Ninja generator by commit 5b114c9bee
(Introduce a cmLocalGenerator::ConvertToIncludeReference function,
2011-09-07, v2.8.7~187^2~4). Its only purpose is to allow the Ninja
generator to use relative paths in `-I` flags. Add a comment explaining
this role.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 672b579..2e0ffdb 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -263,9 +263,10 @@ void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags, language, config); // Add include directory flags. std::string includeFlags = this->LocalGenerator->GetIncludeFlags( - includes, this->GeneratorTarget, language, - language == "RC", // full include paths for RC needed by cmcldeps - false, config); + includes, this->GeneratorTarget, language, config, false, + // full include paths for RC needed by cmcldeps + language == "RC" ? cmLocalGenerator::IncludePathStyle::Absolute + : cmLocalGenerator::IncludePathStyle::Default); if (this->GetGlobalGenerator()->IsGCCOnWindows()) { std::replace(includeFlags.begin(), includeFlags.end(), '\\', '/'); } @@ -324,7 +325,8 @@ std::string cmNinjaTargetGenerator::ComputeIncludes( } std::string includesString = this->LocalGenerator->GetIncludeFlags( - includes, this->GeneratorTarget, language, true, false, config); + includes, this->GeneratorTarget, language, config, false, + cmLocalGenerator::IncludePathStyle::Absolute); this->LocalGenerator->AppendFlags(includesString, this->GetIncludes(language, config)); @@ -1379,8 +1381,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( cmSystemTools::GetParentDirectory(source->GetFullPath())); std::string sourceDirectoryFlag = this->LocalGenerator->GetIncludeFlags( - sourceDirectory, this->GeneratorTarget, language, false, false, - config); + sourceDirectory, this->GeneratorTarget, language, config, false, + cmLocalGenerator::IncludePathStyle::Default); vars["INCLUDES"] = cmStrCat(sourceDirectoryFlag, ' ', vars["INCLUDES"]); } |