summaryrefslogtreecommitdiffstats
path: root/Source/cmNinjaTargetGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-07-09 13:58:13 (GMT)
committerBrad King <brad.king@kitware.com>2015-07-09 13:59:25 (GMT)
commit73bfad72d3b9ce021074b612bfa0a24bd6a6b04a (patch)
tree8bf4f6a962a46971be2103fc11950f08cc42182f /Source/cmNinjaTargetGenerator.cxx
parent6a56740e27fe74b757ff48999a2f152816ee8e52 (diff)
downloadCMake-73bfad72d3b9ce021074b612bfa0a24bd6a6b04a.zip
CMake-73bfad72d3b9ce021074b612bfa0a24bd6a6b04a.tar.gz
CMake-73bfad72d3b9ce021074b612bfa0a24bd6a6b04a.tar.bz2
cmNinjaTargetGenerator: Factor out AddIncludeFlags helper
Factor an AddIncludeFlags method out of ComputeFlagsForObject just like cmMakefileTargetGenerator has already.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx39
1 files changed, 23 insertions, 16 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 7d3962a..6ae45a9 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -135,23 +135,8 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
this->LocalGenerator->AddVisibilityPresetFlags(languageFlags, this->Target,
language);
- std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes,
- this->GeneratorTarget,
- language,
- this->GetConfigName());
// Add include directory flags.
- std::string includeFlags =
- this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget,
- language,
- language == "RC" ? true : false, // full include paths for RC
- // needed by cmcldeps
- false,
- this->GetConfigName());
- if (this->GetGlobalGenerator()->IsGCCOnWindows())
- cmSystemTools::ReplaceString(includeFlags, "\\", "/");
-
- this->LocalGenerator->AppendFlags(languageFlags, includeFlags);
+ this->AddIncludeFlags(languageFlags, language);
// Append old-style preprocessor definition flags.
this->LocalGenerator->AppendFlags(languageFlags,
@@ -180,6 +165,28 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
return flags;
}
+void cmNinjaTargetGenerator::AddIncludeFlags(std::string& languageFlags,
+ std::string const& language)
+{
+ std::vector<std::string> includes;
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ language,
+ this->GetConfigName());
+ // Add include directory flags.
+ std::string includeFlags =
+ this->LocalGenerator->GetIncludeFlags(includes, this->GeneratorTarget,
+ language,
+ language == "RC" ? true : false, // full include paths for RC
+ // needed by cmcldeps
+ false,
+ this->GetConfigName());
+ if (this->GetGlobalGenerator()->IsGCCOnWindows())
+ cmSystemTools::ReplaceString(includeFlags, "\\", "/");
+
+ this->LocalGenerator->AppendFlags(languageFlags, includeFlags);
+}
+
bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
{
if (lang == "C" || lang == "CXX")