aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/executor.py
diff options
context:
space:
mode:
authorNorbert Nemec <Norbert@Nemec-online.de>2019-08-17 12:20:40 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2019-08-17 13:20:40 +0300
commit1cb6177f033dcdf59f354376c509f16906165a97 (patch)
tree861a5b6c9b5f2ec8301b6267a13e965f295a3693 /mesonbuild/cmake/executor.py
parenta20149930630b8b437da5ba4d524f3ec0dc10e18 (diff)
downloadmeson-1cb6177f033dcdf59f354376c509f16906165a97.zip
meson-1cb6177f033dcdf59f354376c509f16906165a97.tar.gz
meson-1cb6177f033dcdf59f354376c509f16906165a97.tar.bz2
avoid cmake syntax error due to "\" path separators on windows
Diffstat (limited to 'mesonbuild/cmake/executor.py')
-rw-r--r--mesonbuild/cmake/executor.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py
index fa09c4d..9bed737 100644
--- a/mesonbuild/cmake/executor.py
+++ b/mesonbuild/cmake/executor.py
@@ -197,6 +197,12 @@ class CMakeExecutor:
c_comp, c_launcher = choose_compiler('c')
cxx_comp, cxx_launcher = choose_compiler('cpp')
+ # on Windows, choose_compiler returns path with \ as separator - replace by / before writing to CMAKE file
+ c_comp = c_comp.replace('\\', '/')
+ c_launcher = c_launcher.replace('\\', '/')
+ cxx_comp = cxx_comp.replace('\\', '/')
+ cxx_launcher = cxx_launcher.replace('\\', '/')
+
# Reset the CMake cache
with open('{}/CMakeCache.txt'.format(build_dir), 'w') as fp:
fp.write('CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1\n')