aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/toolchain.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-06-29 20:52:55 +0300
committerGitHub <noreply@github.com>2021-06-29 20:52:55 +0300
commit4bfee181c5a166e3d429bd265e06d299dce50f30 (patch)
tree8918a0e09f668ed55748ec254c51b4d92b5403a9 /mesonbuild/cmake/toolchain.py
parent81ca0ec7ae975723b8b399b9f142286895a45dab (diff)
parentc0a2025d038a08092212bfc45e7bbb46ff1e8e52 (diff)
downloadmeson-4bfee181c5a166e3d429bd265e06d299dce50f30.zip
meson-4bfee181c5a166e3d429bd265e06d299dce50f30.tar.gz
meson-4bfee181c5a166e3d429bd265e06d299dce50f30.tar.bz2
Merge pull request #8918 from mensinda/pathlibFixes
pathlib: Patch pathlib to work around some bugs (fixes #8263 #7295)
Diffstat (limited to 'mesonbuild/cmake/toolchain.py')
-rw-r--r--mesonbuild/cmake/toolchain.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py
index f3e487d..1a6dcf0 100644
--- a/mesonbuild/cmake/toolchain.py
+++ b/mesonbuild/cmake/toolchain.py
@@ -66,8 +66,8 @@ class CMakeToolchain:
def write(self) -> Path:
if not self.toolchain_file.parent.exists():
self.toolchain_file.parent.mkdir(parents=True)
- self.toolchain_file.write_text(self.generate())
- self.cmcache_file.write_text(self.generate_cache())
+ self.toolchain_file.write_text(self.generate(), encoding='utf-8')
+ self.cmcache_file.write_text(self.generate_cache(), encoding='utf-8')
mlog.cmd_ci_include(self.toolchain_file.as_posix())
return self.toolchain_file
@@ -215,11 +215,11 @@ class CMakeToolchain:
build_dir = Path(self.env.scratch_dir) / '__CMake_compiler_info__'
build_dir.mkdir(parents=True, exist_ok=True)
cmake_file = build_dir / 'CMakeLists.txt'
- cmake_file.write_text(cmake_content)
+ cmake_file.write_text(cmake_content, encoding='utf-8')
# Generate the temporary toolchain file
temp_toolchain_file = build_dir / 'CMakeMesonTempToolchainFile.cmake'
- temp_toolchain_file.write_text(CMakeToolchain._print_vars(self.variables))
+ temp_toolchain_file.write_text(CMakeToolchain._print_vars(self.variables), encoding='utf-8')
# Configure
trace = CMakeTraceParser(self.cmakebin.version(), build_dir)