From fe5d0849dbe4a8a6f4d8cd1d0384b9112fc802b9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 5 Nov 2020 17:21:13 -0500 Subject: cmNinjaTargetGenerator: Consolidate redundant methods --- Source/cmNinjaTargetGenerator.cxx | 12 +++--------- Source/cmNinjaTargetGenerator.h | 3 +-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 5e27356..41067d6 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -129,12 +129,6 @@ bool cmNinjaTargetGenerator::NeedExplicitPreprocessing( return lang == "Fortran"; } -bool cmNinjaTargetGenerator::UsePreprocessedSource( - std::string const& lang) const -{ - return lang == "Fortran"; -} - bool cmNinjaTargetGenerator::CompilePreprocessedSourceWithDefines( std::string const& lang) const { @@ -639,8 +633,8 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang, // For some cases we do an explicit preprocessor invocation. bool const explicitPP = this->NeedExplicitPreprocessing(lang); - bool const compilePPWithDefines = this->UsePreprocessedSource(lang) && - this->CompilePreprocessedSourceWithDefines(lang); + bool const compilePPWithDefines = + explicitPP && this->CompilePreprocessedSourceWithDefines(lang); bool const needDyndep = this->NeedDyndep(lang); std::string flags = "$FLAGS"; @@ -1303,7 +1297,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( preprocess = cmOutputConverter::GetFortranPreprocess(tgtpp); } - bool const compilePP = this->UsePreprocessedSource(language) && + bool const compilePP = explicitPP && (preprocess != cmOutputConverter::FortranPreprocess::NotNeeded); bool const compilePPWithDefines = compilePP && this->CompilePreprocessedSourceWithDefines(language); diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h index a27c9b4..17c7747 100644 --- a/Source/cmNinjaTargetGenerator.h +++ b/Source/cmNinjaTargetGenerator.h @@ -71,11 +71,10 @@ protected: const std::string& config) const; std::string LanguageDependencyRule(std::string const& lang, const std::string& config) const; - bool NeedExplicitPreprocessing(std::string const& lang) const; std::string LanguageDyndepRule(std::string const& lang, const std::string& config) const; bool NeedDyndep(std::string const& lang) const; - bool UsePreprocessedSource(std::string const& lang) const; + bool NeedExplicitPreprocessing(std::string const& lang) const; bool CompilePreprocessedSourceWithDefines(std::string const& lang) const; std::string OrderDependsTargetForTarget(const std::string& config); -- cgit v0.12