소스 검색

Ninja: Order Fortran dyndep file generation explicitly

Each target's dyndep file generation depends on loading information
generated by the same step in its dependencies.  Add an explicit
ordering dependency to ensure the needed information is available.
Without the explicit ordering dependency we were abusing the more
general target ordering rules through the preprocessor rules generating
the `.ddi` files used as input to dyndep file generation.
Brad King 8 년 전
부모
커밋
b57b7d8e55
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      Source/cmNinjaTargetGenerator.cxx

+ 11 - 0
Source/cmNinjaTargetGenerator.cxx

@@ -767,6 +767,17 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements()
 
     ddOutputs.push_back(this->GetDyndepFilePath("Fortran"));
 
+    // Make sure dyndep files for all our dependencies have already
+    // been generated so that the 'FortranModules.json' files they
+    // produced as side-effects are available for us to read.
+    // Ideally we should depend on the 'FortranModules.json' files
+    // from our dependencies directly, but we don't know which of
+    // our dependencies produces them.  Fixing this will require
+    // refactoring the Ninja generator to generate targets in
+    // dependency order so that we can collect the needed information.
+    this->GetLocalGenerator()->AppendTargetDepends(this->GeneratorTarget,
+                                                   ddOrderOnlyDeps);
+
     this->GetGlobalGenerator()->WriteBuild(
       this->GetBuildFileStream(), ddComment, ddRule, ddOutputs, ddImplicitOuts,
       ddExplicitDeps, ddImplicitDeps, ddOrderOnlyDeps, ddVars);