diff options
author | Brad King <brad.king@kitware.com> | 2023-05-08 20:56:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-05-09 13:56:41 (GMT) |
commit | 9075ebda60922d8d11dd15d15c714c36ec3874cd (patch) | |
tree | db2b886ec20ac0fc0aab9585b5fad613395d618a /Source/cmGlobalNinjaGenerator.cxx | |
parent | 266634bce5defda08d51682a5d99782b4ebd044e (diff) | |
download | CMake-9075ebda60922d8d11dd15d15c714c36ec3874cd.zip CMake-9075ebda60922d8d11dd15d15c714c36ec3874cd.tar.gz CMake-9075ebda60922d8d11dd15d15c714c36ec3874cd.tar.bz2 |
Ninja: Rename internal Fortran scanner flag from --pp= to --src=
The value represents the source file to be scanned.
It is not always preprocessor output.
Diffstat (limited to 'Source/cmGlobalNinjaGenerator.cxx')
-rw-r--r-- | Source/cmGlobalNinjaGenerator.cxx | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx index 84c85e0..f3927b4 100644 --- a/Source/cmGlobalNinjaGenerator.cxx +++ b/Source/cmGlobalNinjaGenerator.cxx @@ -2226,9 +2226,9 @@ Compilation of source files within a target is split into the following steps: depfile = $DEP_FILE command = gfortran -cpp $DEFINES $INCLUDES $FLAGS -E $in -o $out && cmake -E cmake_ninja_depends \ - --tdi=FortranDependInfo.json --pp=$out --dep=$DEP_FILE \ - --obj=$OBJ_FILE --ddi=$DYNDEP_INTERMEDIATE_FILE \ - --lang=Fortran + --tdi=FortranDependInfo.json --lang=Fortran \ + --src=$out --dep=$DEP_FILE --obj=$OBJ_FILE \ + --ddi=$DYNDEP_INTERMEDIATE_FILE build src.f90-pp.f90 | src.f90.o.ddi: Fortran_PREPROCESS src.f90 OBJ_FILE = src.f90.o @@ -2296,14 +2296,14 @@ struct cmSourceInfo }; cm::optional<cmSourceInfo> cmcmd_cmake_ninja_depends_fortran( - std::string const& arg_tdi, std::string const& arg_pp); + std::string const& arg_tdi, std::string const& arg_src); } int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, std::vector<std::string>::const_iterator argEnd) { std::string arg_tdi; - std::string arg_pp; + std::string arg_src; std::string arg_dep; std::string arg_obj; std::string arg_ddi; @@ -2311,8 +2311,8 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, for (std::string const& arg : cmMakeRange(argBeg, argEnd)) { if (cmHasLiteralPrefix(arg, "--tdi=")) { arg_tdi = arg.substr(6); - } else if (cmHasLiteralPrefix(arg, "--pp=")) { - arg_pp = arg.substr(5); + } else if (cmHasLiteralPrefix(arg, "--src=")) { + arg_src = arg.substr(6); } else if (cmHasLiteralPrefix(arg, "--dep=")) { arg_dep = arg.substr(6); } else if (cmHasLiteralPrefix(arg, "--obj=")) { @@ -2321,6 +2321,9 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, arg_ddi = arg.substr(6); } else if (cmHasLiteralPrefix(arg, "--lang=")) { arg_lang = arg.substr(7); + } else if (cmHasLiteralPrefix(arg, "--pp=")) { + // CMake 3.26 and below used '--pp=' instead of '--src='. + arg_src = arg.substr(5); } else { cmSystemTools::Error( cmStrCat("-E cmake_ninja_depends unknown argument: ", arg)); @@ -2331,8 +2334,8 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, cmSystemTools::Error("-E cmake_ninja_depends requires value for --tdi="); return 1; } - if (arg_pp.empty()) { - cmSystemTools::Error("-E cmake_ninja_depends requires value for --pp="); + if (arg_src.empty()) { + cmSystemTools::Error("-E cmake_ninja_depends requires value for --src="); return 1; } if (arg_dep.empty()) { @@ -2354,7 +2357,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, cm::optional<cmSourceInfo> info; if (arg_lang == "Fortran") { - info = cmcmd_cmake_ninja_depends_fortran(arg_tdi, arg_pp); + info = cmcmd_cmake_ninja_depends_fortran(arg_tdi, arg_src); } else { cmSystemTools::Error( cmStrCat("-E cmake_ninja_depends does not understand the ", arg_lang, @@ -2371,7 +2374,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, { cmGeneratedFileStream depfile(arg_dep); - depfile << cmSystemTools::ConvertToUnixOutputPath(arg_pp) << ":"; + depfile << cmSystemTools::ConvertToUnixOutputPath(arg_src) << ":"; for (std::string const& include : info->Includes) { depfile << " \\\n " << cmSystemTools::ConvertToUnixOutputPath(include); } @@ -2389,7 +2392,7 @@ int cmcmd_cmake_ninja_depends(std::vector<std::string>::const_iterator argBeg, namespace { cm::optional<cmSourceInfo> cmcmd_cmake_ninja_depends_fortran( - std::string const& arg_tdi, std::string const& arg_pp) + std::string const& arg_tdi, std::string const& arg_src) { cm::optional<cmSourceInfo> info; cmFortranCompiler fc; @@ -2441,9 +2444,9 @@ cm::optional<cmSourceInfo> cmcmd_cmake_ninja_depends_fortran( cmFortranSourceInfo finfo; std::set<std::string> defines; cmFortranParser parser(fc, includes, defines, finfo); - if (!cmFortranParser_FilePush(&parser, arg_pp.c_str())) { + if (!cmFortranParser_FilePush(&parser, arg_src.c_str())) { cmSystemTools::Error( - cmStrCat("-E cmake_ninja_depends failed to open ", arg_pp)); + cmStrCat("-E cmake_ninja_depends failed to open ", arg_src)); return info; } if (cmFortran_yyparse(parser.Scanner) != 0) { |