소스 검색

cmNinjaTargetGenerator: Consolidate redundant methods

Brad King 5 년 전
부모
커밋
fe5d0849db
2개의 변경된 파일4개의 추가작업 그리고 11개의 파일을 삭제
  1. 3 9
      Source/cmNinjaTargetGenerator.cxx
  2. 1 2
      Source/cmNinjaTargetGenerator.h

+ 3 - 9
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);

+ 1 - 2
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);