summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-11-05 22:21:13 (GMT)
committerBrad King <brad.king@kitware.com>2020-11-06 16:43:51 (GMT)
commitfe5d0849dbe4a8a6f4d8cd1d0384b9112fc802b9 (patch)
tree3a94955bab59ae9fd43d86f4c6f0dd8b19ca1811 /Source
parenta117101fbd1a7b17a4e52e16c1798b4a9e95f9b3 (diff)
downloadCMake-fe5d0849dbe4a8a6f4d8cd1d0384b9112fc802b9.zip
CMake-fe5d0849dbe4a8a6f4d8cd1d0384b9112fc802b9.tar.gz
CMake-fe5d0849dbe4a8a6f4d8cd1d0384b9112fc802b9.tar.bz2
cmNinjaTargetGenerator: Consolidate redundant methods
Diffstat (limited to 'Source')
-rw-r--r--Source/cmNinjaTargetGenerator.cxx12
-rw-r--r--Source/cmNinjaTargetGenerator.h3
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);