mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 14:20:06 -06:00
NMake: Document response file encoding heuristic in a comment
Since commit f3f57cc4ed (NMake: Use UTF-8 with BOM if supported by
nmake, 2021-04-22, v3.21.0-rc1~217^2) the encoding of response files is
selected based on the makefile encoding. In principle these may be
orthogonal, but in practice it is a useful heuristic. Call out this
heuristic in a comment, and leave a FIXME to do something better.
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
#include <cmext/algorithm>
|
#include <cmext/algorithm>
|
||||||
#include <cmext/string_view>
|
#include <cmext/string_view>
|
||||||
|
|
||||||
|
#include "cm_codecvt.hxx"
|
||||||
|
|
||||||
#include "cmComputeLinkInformation.h"
|
#include "cmComputeLinkInformation.h"
|
||||||
#include "cmCustomCommand.h"
|
#include "cmCustomCommand.h"
|
||||||
#include "cmCustomCommandGenerator.h"
|
#include "cmCustomCommandGenerator.h"
|
||||||
@@ -2046,11 +2048,17 @@ std::string cmMakefileTargetGenerator::CreateResponseFile(
|
|||||||
const char* name, std::string const& options,
|
const char* name, std::string const& options,
|
||||||
std::vector<std::string>& makefile_depends)
|
std::vector<std::string>& makefile_depends)
|
||||||
{
|
{
|
||||||
|
// FIXME: Find a better way to determine the response file encoding,
|
||||||
|
// perhaps using tool-specific platform information variables.
|
||||||
|
// For now, use the makefile encoding as a heuristic.
|
||||||
|
codecvt::Encoding responseEncoding =
|
||||||
|
this->GlobalGenerator->GetMakefileEncoding();
|
||||||
|
|
||||||
// Create the response file.
|
// Create the response file.
|
||||||
std::string responseFileNameFull =
|
std::string responseFileNameFull =
|
||||||
cmStrCat(this->TargetBuildDirectoryFull, '/', name);
|
cmStrCat(this->TargetBuildDirectoryFull, '/', name);
|
||||||
cmGeneratedFileStream responseStream(
|
cmGeneratedFileStream responseStream(responseFileNameFull, false,
|
||||||
responseFileNameFull, false, this->GlobalGenerator->GetMakefileEncoding());
|
responseEncoding);
|
||||||
responseStream.SetCopyIfDifferent(true);
|
responseStream.SetCopyIfDifferent(true);
|
||||||
responseStream << options << "\n";
|
responseStream << options << "\n";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user