ninja: name dyndep internal files using the object file

Now that preprocessing outputs are not necessarily used all the way
through, the output name is a better base name to use for these files.
This commit is contained in:
Ben Boeckel
2019-02-20 13:20:28 -05:00
committed by Brad King
parent 7c78adca8e
commit f22c18b1c1
2 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -1577,10 +1577,10 @@ Compilation of source files within a target is split into the following steps:
--obj=$OBJ_FILE --ddi=$DYNDEP_INTERMEDIATE_FILE \
--lang=Fortran
build src.f90-pp.f90 | src.f90-pp.f90.ddi: Fortran_PREPROCESS src.f90
build src.f90-pp.f90 | src.f90.o.ddi: Fortran_PREPROCESS src.f90
OBJ_FILE = src.f90.o
DEP_FILE = src.f90-pp.f90.d
DYNDEP_INTERMEDIATE_FILE = src.f90-pp.f90.ddi
DEP_FILE = src.f90.o.d
DYNDEP_INTERMEDIATE_FILE = src.f90.o.ddi
The ``cmake -E cmake_ninja_depends`` tool reads the preprocessed output
and generates the ninja depfile for preprocessor dependencies. It also
@@ -1596,7 +1596,7 @@ Compilation of source files within a target is split into the following steps:
command = cmake -E cmake_ninja_dyndep \
--tdi=FortranDependInfo.json --lang=Fortran --dd=$out $in
build Fortran.dd: Fortran_DYNDEP src1.f90-pp.f90.ddi src2.f90-pp.f90.ddi
build Fortran.dd: Fortran_DYNDEP src1.f90.o.ddi src2.f90.o.ddi
The ``cmake -E cmake_ninja_dyndep`` tool reads the "ddi" files from all
sources in the target and the ``FortranModules.json`` files from targets
+2 -2
View File
@@ -1113,7 +1113,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
// Explicit preprocessing always uses a depfile.
ppVars["DEP_FILE"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ppFileName + ".d", cmOutputConverter::SHELL);
objectFileName + ".d", cmOutputConverter::SHELL);
if (compilePP) {
// The actual compilation does not need a depfile because it
// depends on the already-preprocessed source.
@@ -1126,7 +1126,7 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement(
ppVars["OBJ_FILE"] = objectFileName;
// Tell dependency scanner where to store dyndep intermediate results.
std::string const ddiFile = ppFileName + ".ddi";
std::string const ddiFile = objectFileName + ".ddi";
ppVars["DYNDEP_INTERMEDIATE_FILE"] = ddiFile;
ppImplicitOuts.push_back(ddiFile);
this->DDIFiles[language].push_back(ddiFile);