https://github.com/Kitware/CMake
Revision de9840d1b89481132ee128715506f6aee9d0277c authored by Brad King on 23 August 2017, 15:09:17 UTC, committed by Brad King on 23 August 2017, 15:10:41 UTC
With MSVC the Ninja generator extracts the `cl -showIncludes` prefix.
When MSVC is configured to have non-English output, e.g. via
`VSLANG=2052` in the environment, then `cl` prints the prefix encoded
for the current code page, which is not necessarily UTF-8 encoding.
Currently we fail to convert the prefix to our internal UTF-8 encoding,
but assume it is UTF-8 later.

While writing `rules.ninja`, the Ninja generator converts our internal
UTF-8 encoding to the current code page.  The `msvc_deps_prefix =` line
needs to be encoded as the current code page so that `ninja` can match
in the output from `cl -showIncludes` during the build.

Prior to commit v3.9.0-rc1~47^2 (codecvt: Re-implement do_out and
do_unshift, 2017-05-25), the non-UTF-8 prefix extracted above was
written without noticing its incorrect internal encoding.  The
`rules.ninja` file was successfully written, but possibly with a mangled
`msvc_deps_prefix`.  Since that commit the output stream correctly
rejects the non-UTF-8 byte sequence and writing `rules.ninja` fails.

Fix this by correctly converting the `cl -showIncludes` output from the
current code page to our internal UTF-8 encoding.

Fixes: #17191
1 parent fca4423
History
Tip revision: de9840d1b89481132ee128715506f6aee9d0277c authored by Brad King on 23 August 2017, 15:09:17 UTC
Ninja: Fix support for MSVC with non-English output
Tip revision: de9840d
File Mode Size
Auxiliary
Help
Licenses
Modules
Packaging
Source
Templates
Tests
Utilities
.clang-format -rw-r--r-- 217 bytes
.clang-tidy -rw-r--r-- 806 bytes
.gitattributes -rw-r--r-- 1.1 KB
.gitignore -rw-r--r-- 64 bytes
.hooks-config -rw-r--r-- 418 bytes
CMakeCPack.cmake -rw-r--r-- 9.5 KB
CMakeCPackOptions.cmake.in -rw-r--r-- 12.6 KB
CMakeGraphVizOptions.cmake -rw-r--r-- 153 bytes
CMakeLists.txt -rw-r--r-- 31.0 KB
CMakeLogo.gif -rw-r--r-- 4.4 KB
CONTRIBUTING.rst -rw-r--r-- 1.8 KB
CTestConfig.cmake -rw-r--r-- 440 bytes
CTestCustom.cmake.in -rw-r--r-- 6.1 KB
CompileFlags.cmake -rw-r--r-- 3.2 KB
Copyright.txt -rw-r--r-- 4.9 KB
DartConfig.cmake -rw-r--r-- 374 bytes
README.rst -rw-r--r-- 2.9 KB
bootstrap -rwxr-xr-x 47.2 KB
cmake_uninstall.cmake.in -rw-r--r-- 790 bytes
configure -rwxr-xr-x 99 bytes
doxygen.config -rw-r--r-- 27.4 KB

README.rst

back to top