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

Method CreateLinkScript

Source/cmMakefileTargetGenerator.cxx:2089–2116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2087}
2088
2089void cmMakefileTargetGenerator::CreateLinkScript(
2090 char const* name, std::vector<std::string> const& link_commands,
2091 std::vector<std::string>& makefile_commands,
2092 std::vector<std::string>& makefile_depends)
2093{
2094 // Create the link script file.
2095 std::string linkScriptName =
2096 cmStrCat(this->TargetBuildDirectoryFull, '/', name);
2097 cmGeneratedFileStream linkScriptStream(linkScriptName);
2098 linkScriptStream.SetCopyIfDifferent(true);
2099 for (std::string const& link_command : link_commands) {
2100 // Do not write out empty commands or commands beginning in the
2101 // shell no-op ":".
2102 if (!link_command.empty() && link_command[0] != ':') {
2103 linkScriptStream << link_command << "\n";
2104 }
2105 }
2106
2107 // Create the makefile command to invoke the link script.
2108 std::string link_command =
2109 cmStrCat("$(CMAKE_COMMAND) -E cmake_link_script ",
2110 this->LocalGenerator->ConvertToOutputFormat(
2111 this->LocalGenerator->MaybeRelativeToCurBinDir(linkScriptName),
2112 cmOutputConverter::SHELL),
2113 " --verbose=$(VERBOSE)");
2114 makefile_commands.push_back(std::move(link_command));
2115 makefile_depends.push_back(std::move(linkScriptName));
2116}
2117
2118bool cmMakefileTargetGenerator::CheckUseResponseFileForObjects(
2119 std::string const& l) const

Callers 4

WriteExecutableRuleMethod · 0.80
WriteLibraryRulesMethod · 0.80

Calls 7

moveFunction · 0.85
SetCopyIfDifferentMethod · 0.80
push_backMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
ConvertToOutputFormatMethod · 0.45

Tested by

no test coverage detected