summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.h
diff options
context:
space:
mode:
authorJustin Goshi <jgoshi@microsoft.com>2020-04-08 21:02:03 (GMT)
committerJustin Goshi <jgoshi@microsoft.com>2020-04-13 19:54:47 (GMT)
commitbc877a7e944d2a83867b4d55073fe3f83bcecc42 (patch)
tree2740d78f3d490b5791704df961fc9d43fab01e1e /Source/cmMakefile.h
parent37fa5122c2c1e2138b9e01191dc3cc1800f6ba40 (diff)
downloadCMake-bc877a7e944d2a83867b4d55073fe3f83bcecc42.zip
CMake-bc877a7e944d2a83867b4d55073fe3f83bcecc42.tar.gz
CMake-bc877a7e944d2a83867b4d55073fe3f83bcecc42.tar.bz2
Add support to indicate UTF-8 custom command pipe output encoding
Adds a flag to indicate that pipe output from a custom command should be interpreted as UTF-8 encoded. This change does not introduce a public way to set the flag, but generators that create internally-generated commands know if they are calling cmake, which uses UTF-8 pipes. MSBuild added support for interpreting output of PreBuildEvent, PreLinkEvent, PostBuildEvent, and CustomBuildStep as UTF-8. This change will appear in Visual Studio 16.6 Preview 3. It is opt-in, and you need to add the StdOutEncoding tag. MSBuild treats these as property bags so if we emit the tag for earlier versions of Visual Studio it would be safely ignored. This change emits the StdOutEncoding tag and sets it to UTF-8 whenever the custom command UTF-8 pipe flag is set. This fixes globalization issues when the output from cmake contained characters that required MSBuild to interpret as UTF-8 before displaying them.
Diffstat (limited to 'Source/cmMakefile.h')
-rw-r--r--Source/cmMakefile.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 9a7eff9..04a1f2d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -188,7 +188,8 @@ public:
const cmCustomCommandLines& commandLines, cmCustomCommandType type,
const char* comment, const char* workingDir, bool escapeOldStyle = true,
bool uses_terminal = false, const std::string& depfile = "",
- const std::string& job_pool = "", bool command_expand_lists = false);
+ const std::string& job_pool = "", bool command_expand_lists = false,
+ bool stdPipesUTF8 = false);
/**
* Called for each file with custom command.
@@ -205,7 +206,8 @@ public:
const char* workingDir, const CommandSourceCallback& callback = nullptr,
bool replace = false, bool escapeOldStyle = true,
bool uses_terminal = false, bool command_expand_lists = false,
- const std::string& depfile = "", const std::string& job_pool = "");
+ const std::string& depfile = "", const std::string& job_pool = "",
+ bool stdPipesUTF8 = false);
void AddCustomCommandToOutput(
const std::vector<std::string>& outputs,
const std::vector<std::string>& byproducts,
@@ -216,7 +218,8 @@ public:
const char* workingDir, const CommandSourceCallback& callback = nullptr,
bool replace = false, bool escapeOldStyle = true,
bool uses_terminal = false, bool command_expand_lists = false,
- const std::string& depfile = "", const std::string& job_pool = "");
+ const std::string& depfile = "", const std::string& job_pool = "",
+ bool stdPipesUTF8 = false);
void AddCustomCommandOldStyle(const std::string& target,
const std::vector<std::string>& outputs,
const std::vector<std::string>& depends,
@@ -284,7 +287,8 @@ public:
const std::vector<std::string>& depends,
const cmCustomCommandLines& commandLines, bool escapeOldStyle = true,
const char* comment = nullptr, bool uses_terminal = false,
- bool command_expand_lists = false, const std::string& job_pool = "");
+ bool command_expand_lists = false, const std::string& job_pool = "",
+ bool stdPipesUTF8 = false);
/**
* Add a subdirectory to the build.