| 1955 | } |
| 1956 | |
| 1957 | void 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 | |
| 1995 | void cmMakefileTargetGenerator::AppendTargetDepends( |
| 1996 | std::vector<std::string>& depends, bool ignoreType) |
no test coverage detected