MCPcopy Create free account
hub / github.com/Kitware/CMake / GetPreprocessedFilePath

Method GetPreprocessedFilePath

Source/cmNinjaTargetGenerator.cxx:458–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458std::string cmNinjaTargetGenerator::GetPreprocessedFilePath(
459 cmSourceFile const* source, std::string const& config) const
460{
461 // Choose an extension to compile already-preprocessed source.
462 std::string ppExt = source->GetExtension();
463 if (cmHasPrefix(ppExt, 'F')) {
464 // Some Fortran compilers automatically enable preprocessing for
465 // upper-case extensions. Since the source is already preprocessed,
466 // use a lower-case extension.
467 ppExt = cmSystemTools::LowerCase(ppExt);
468 }
469 if (ppExt == "fpp") {
470 // Some Fortran compilers automatically enable preprocessing for
471 // the ".fpp" extension. Since the source is already preprocessed,
472 // use the ".f" extension.
473 ppExt = "f";
474 }
475
476 // Take the object file name and replace the extension.
477 std::string const& objName = this->GeneratorTarget->GetObjectName(source);
478 std::string const& objExt =
479 this->GetGlobalGenerator()->GetLanguageOutputExtension(*source);
480 assert(objName.size() >= objExt.size());
481 std::string const ppName =
482 cmStrCat(objName.substr(0, objName.size() - objExt.size()), "-pp.", ppExt);
483
484 return cmStrCat(this->GetObjectFileDir(config), '/', ppName);
485}
486
487std::string cmNinjaTargetGenerator::GetDyndepFilePath(
488 std::string const& lang, std::string const& config) const

Callers 1

Calls 8

GetGlobalGeneratorMethod · 0.95
GetObjectFileDirMethod · 0.95
cmHasPrefixFunction · 0.85
GetExtensionMethod · 0.80
cmStrCatFunction · 0.70
sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected