| 2171 | } |
| 2172 | |
| 2173 | std::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 | |
| 2206 | std::unique_ptr<cmLinkLineComputer> |
| 2207 | cmMakefileTargetGenerator::CreateLinkLineComputer( |
no test coverage detected