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

Method WriteTargetDriverRule

Source/cmMakefileTargetGenerator.cxx:1957–1993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1955}
1956
1957void cmMakefileTargetGenerator::WriteTargetDriverRule(
1958 std::string const& main_output, bool relink)
1959{
1960 // Compute the name of the driver target.
1961 std::string dir =
1962 this->LocalGenerator->GetRelativeTargetDirectory(this->GeneratorTarget);
1963 std::string buildTargetRuleName =
1964 cmStrCat(std::move(dir), relink ? "/preinstall" : "/build");
1965 buildTargetRuleName =
1966 this->LocalGenerator->MaybeRelativeToTopBinDir(buildTargetRuleName);
1967
1968 // Build the list of target outputs to drive.
1969 std::vector<std::string> depends{ main_output };
1970
1971 char const* comment = nullptr;
1972 if (relink) {
1973 // Setup the comment for the preinstall driver.
1974 comment = "Rule to relink during preinstall.";
1975 } else {
1976 // Setup the comment for the main build driver.
1977 comment = "Rule to build all files generated by this target.";
1978
1979 // Make sure all custom command outputs in this target are built.
1980 if (this->CustomCommandDriver == OnBuild) {
1981 this->DriveCustomCommands(depends);
1982 }
1983
1984 // Make sure the extra files are built.
1985 cm::append(depends, this->ExtraFiles);
1986 }
1987
1988 // Write the driver rule.
1989 std::vector<std::string> no_commands;
1990 this->LocalGenerator->WriteMakeRule(*this->BuildFileStream, comment,
1991 buildTargetRuleName, depends,
1992 no_commands, true);
1993}
1994
1995void cmMakefileTargetGenerator::AppendTargetDepends(
1996 std::vector<std::string>& depends, bool ignoreType)

Callers 6

WriteExecutableRuleMethod · 0.80
WriteRuleFilesMethod · 0.80
WriteLibraryRulesMethod · 0.80

Calls 7

DriveCustomCommandsMethod · 0.95
moveFunction · 0.85
appendFunction · 0.85
cmStrCatFunction · 0.70
WriteMakeRuleMethod · 0.45

Tested by

no test coverage detected