diff options
author | Brad King <brad.king@kitware.com> | 2015-07-09 14:05:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-07-09 14:06:24 (GMT) |
commit | 0837538e461cfdbc5c673d7f2bf64f6631099bdf (patch) | |
tree | c271915de7062275ff9f8beb9a0d0a3982ec983e /Source/cmNinjaTargetGenerator.cxx | |
parent | f4875bbdd6cc090f5c79f358c55c8b936c6254fd (diff) | |
download | CMake-0837538e461cfdbc5c673d7f2bf64f6631099bdf.zip CMake-0837538e461cfdbc5c673d7f2bf64f6631099bdf.tar.gz CMake-0837538e461cfdbc5c673d7f2bf64f6631099bdf.tar.bz2 |
cmCommonTargetGenerator: Adopt GetFlags method
De-duplicate per-target flag computation in Makefile and Ninja target
generators.
Diffstat (limited to 'Source/cmNinjaTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 50 |
1 files changed, 1 insertions, 49 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index cd54c4d..05120da 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -110,55 +110,7 @@ std::string cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile const* source, const std::string& language) { - bool hasLangCached = this->LanguageFlags.count(language) != 0; - std::string& languageFlags = this->LanguageFlags[language]; - if(!hasLangCached) - { - this->AddFeatureFlags(languageFlags, language); - - this->GetLocalGenerator()->AddArchitectureFlags(languageFlags, - this->GeneratorTarget, - language, - this->GetConfigName()); - - // Fortran-specific flags computed for this target. - if(language == "Fortran") - { - this->AddFortranFlags(languageFlags); - } - - // Add shared-library flags if needed. - this->LocalGenerator->AddCMP0018Flags(languageFlags, this->Target, - language, - this->GetConfigName()); - - this->LocalGenerator->AddVisibilityPresetFlags(languageFlags, this->Target, - language); - - // Add include directory flags. - this->AddIncludeFlags(languageFlags, language); - - // Append old-style preprocessor definition flags. - this->LocalGenerator->AppendFlags(languageFlags, - this->Makefile->GetDefineFlags()); - - // Add framework directory flags. - this->LocalGenerator-> - AppendFlags(languageFlags, this->GetFrameworkFlags(language)); - - // Add target-specific flags. - this->LocalGenerator->AddCompileOptions(languageFlags, this->Target, - language, - this->GetConfigName()); - } - - std::string flags = languageFlags; - - // Add Fortran format flags. - if(language == "Fortran") - { - this->AppendFortranFormatFlags(flags, *source); - } + std::string flags = this->GetFlags(language); // Add source file specific flags. this->LocalGenerator->AppendFlags(flags, |