| 1442 | } |
| 1443 | |
| 1444 | void cmMakefileTargetGenerator::WriteTargetDependRules() |
| 1445 | { |
| 1446 | // must write the targets depend info file |
| 1447 | this->InfoFileNameFull = |
| 1448 | cmStrCat(this->TargetBuildDirectoryFull, "/DependInfo.cmake"); |
| 1449 | this->InfoFileStream = |
| 1450 | cm::make_unique<cmGeneratedFileStream>(this->InfoFileNameFull); |
| 1451 | if (!this->InfoFileStream) { |
| 1452 | return; |
| 1453 | } |
| 1454 | this->InfoFileStream->SetCopyIfDifferent(true); |
| 1455 | this->LocalGenerator->WriteDependLanguageInfo(*this->InfoFileStream, |
| 1456 | this->GeneratorTarget); |
| 1457 | |
| 1458 | // Store multiple output pairs in the depend info file. |
| 1459 | if (!this->MultipleOutputPairs.empty()) { |
| 1460 | /* clang-format off */ |
| 1461 | *this->InfoFileStream |
| 1462 | << "\n" |
| 1463 | << "# Pairs of files generated by the same build rule.\n" |
| 1464 | << "set(CMAKE_MULTIPLE_OUTPUT_PAIRS\n"; |
| 1465 | /* clang-format on */ |
| 1466 | for (auto const& pi : this->MultipleOutputPairs) { |
| 1467 | *this->InfoFileStream |
| 1468 | << " " << cmOutputConverter::EscapeForCMake(pi.first) << " " |
| 1469 | << cmOutputConverter::EscapeForCMake(pi.second) << "\n"; |
| 1470 | } |
| 1471 | *this->InfoFileStream << " )\n\n"; |
| 1472 | } |
| 1473 | |
| 1474 | // Store list of targets linked directly or transitively. |
| 1475 | { |
| 1476 | /* clang-format off */ |
| 1477 | *this->InfoFileStream |
| 1478 | << "\n" |
| 1479 | "# Targets to which this target links which contain Fortran sources.\n" |
| 1480 | "set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES\n"; |
| 1481 | /* clang-format on */ |
| 1482 | auto const dirs = |
| 1483 | this->GetLinkedTargetDirectories("Fortran", this->GetConfigName()); |
| 1484 | for (std::string const& d : dirs.Direct) { |
| 1485 | *this->InfoFileStream << " \"" << d << "/DependInfo.cmake\"\n"; |
| 1486 | } |
| 1487 | *this->InfoFileStream << " )\n"; |
| 1488 | |
| 1489 | /* clang-format off */ |
| 1490 | *this->InfoFileStream |
| 1491 | << "\n" |
| 1492 | "# Targets to which this target links which contain Fortran sources.\n" |
| 1493 | "set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES\n"; |
| 1494 | /* clang-format on */ |
| 1495 | for (std::string const& d : dirs.Forward) { |
| 1496 | *this->InfoFileStream << " \"" << d << "/DependInfo.cmake\"\n"; |
| 1497 | } |
| 1498 | *this->InfoFileStream << " )\n"; |
| 1499 | } |
| 1500 | |
| 1501 | std::string const& working_dir = |
no test coverage detected