cmNinjaTargetGenerator: Factor out AddIncludeFlags helper
Factor an AddIncludeFlags method out of ComputeFlagsForObject just like cmMakefileTargetGenerator has already.
This commit is contained in:
parent
6a56740e27
commit
73bfad72d3
|
@ -135,23 +135,8 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
|
||||||
this->LocalGenerator->AddVisibilityPresetFlags(languageFlags, this->Target,
|
this->LocalGenerator->AddVisibilityPresetFlags(languageFlags, this->Target,
|
||||||
language);
|
language);
|
||||||
|
|
||||||
std::vector<std::string> includes;
|
|
||||||
this->LocalGenerator->GetIncludeDirectories(includes,
|
|
||||||
this->GeneratorTarget,
|
|
||||||
language,
|
|
||||||
this->GetConfigName());
|
|
||||||
// Add include directory flags.
|
// Add include directory flags.
|
||||||
std::string includeFlags =
|
this->AddIncludeFlags(languageFlags, language);
|
||||||
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);
|
|
||||||
|
|
||||||
// Append old-style preprocessor definition flags.
|
// Append old-style preprocessor definition flags.
|
||||||
this->LocalGenerator->AppendFlags(languageFlags,
|
this->LocalGenerator->AppendFlags(languageFlags,
|
||||||
|
@ -180,6 +165,28 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source,
|
||||||
return flags;
|
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
|
bool cmNinjaTargetGenerator::NeedDepTypeMSVC(const std::string& lang) const
|
||||||
{
|
{
|
||||||
if (lang == "C" || lang == "CXX")
|
if (lang == "C" || lang == "CXX")
|
||||||
|
|
|
@ -81,6 +81,8 @@ protected:
|
||||||
std::string ComputeFlagsForObject(cmSourceFile const* source,
|
std::string ComputeFlagsForObject(cmSourceFile const* source,
|
||||||
const std::string& language);
|
const std::string& language);
|
||||||
|
|
||||||
|
void AddIncludeFlags(std::string& flags, std::string const& lang);
|
||||||
|
|
||||||
std::string ComputeDefines(cmSourceFile const* source,
|
std::string ComputeDefines(cmSourceFile const* source,
|
||||||
const std::string& language);
|
const std::string& language);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue