cmNinjaTargetGenerator: Consolidate redundant methods

This commit is contained in:
Brad King
2020-11-05 17:21:13 -05:00
parent a117101fbd
commit fe5d0849db
2 changed files with 4 additions and 11 deletions
+3 -9
View File
@@ -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);
+1 -2
View File
@@ -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);