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

Method CreateResponseFile

Source/cmMakefileTargetGenerator.cxx:2173–2204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2171}
2172
2173std::string cmMakefileTargetGenerator::CreateResponseFile(
2174 std::string const& name, std::string const& options,
2175 std::vector<std::string>& makefile_depends, std::string const& language)
2176{
2177 // FIXME: Find a better way to determine the response file encoding,
2178 // perhaps using tool-specific platform information variables.
2179 // For now, use the makefile encoding as a heuristic.
2180 codecvt_Encoding responseEncoding =
2181 this->GlobalGenerator->GetMakefileEncoding();
2182 // Non-MSVC tooling doesn't understand BOM encoded files.
2183 if (responseEncoding == codecvt_Encoding::UTF8_WITH_BOM &&
2184 (language == "CUDA" || !this->Makefile->IsOn("MSVC"))) {
2185 responseEncoding = codecvt_Encoding::UTF8;
2186 }
2187
2188 // Create the response file.
2189 std::string responseFileNameFull =
2190 cmStrCat(this->TargetBuildDirectoryFull, '/', name);
2191 cmGeneratedFileStream responseStream(responseFileNameFull, false,
2192 responseEncoding);
2193 responseStream.SetCopyIfDifferent(true);
2194 responseStream << options << "\n";
2195
2196 // Add a dependency so the target will rebuild when the set of
2197 // objects changes.
2198 makefile_depends.push_back(std::move(responseFileNameFull));
2199
2200 // Construct the name to be used on the command line.
2201 std::string responseFileName =
2202 cmStrCat(this->TargetBuildDirectory, '/', name);
2203 return responseFileName;
2204}
2205
2206std::unique_ptr<cmLinkLineComputer>
2207cmMakefileTargetGenerator::CreateLinkLineComputer(

Callers 3

CreateLinkLibsMethod · 0.95
CreateObjectListsMethod · 0.95
AddIncludeFlagsMethod · 0.95

Calls 6

moveFunction · 0.85
SetCopyIfDifferentMethod · 0.80
push_backMethod · 0.80
cmStrCatFunction · 0.70
GetMakefileEncodingMethod · 0.45
IsOnMethod · 0.45

Tested by

no test coverage detected