summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2024-03-10 23:26:02 -0400
committerDylan Baker <dylan@pnwbakers.com>2024-10-04 08:57:11 -0700
commiteda59e141d30204908ef1f56b2637164310c9ccc (patch)
treedb990d7b9d207d96d49321b7ab238ac34b7ece04
parent4c3bb4f67b49359a1f3f1441ad4a736f78266f5f (diff)
downloadmeson-eda59e141d30204908ef1f56b2637164310c9ccc.tar.gz
Turn off CMake compile launcher when using zig
This setting is for things like `ccache`, but if Meson treats zig that way, then it will expand the second argument to become: ``` /usr/bin/zig /usr/lib64/ccache/cc ``` in CMake and `/usr/lib64/ccache/cc` is _not_ an argument to `zig`. If you run ``` $ CC='zig cc' CXX='zig c++' ./meson.py setup 'test cases/cmake/1 basic' build ``` then CMake will fail to compile a "simple test program" and setup fails.
-rw-r--r--mesonbuild/cmake/toolchain.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py
index 89d5d8444..7d73a7cea 100644
--- a/mesonbuild/cmake/toolchain.py
+++ b/mesonbuild/cmake/toolchain.py
@@ -198,6 +198,8 @@ class CMakeToolchain:
if compiler.get_argument_syntax() == 'msvc':
return arg.startswith('/')
else:
+ if compiler.exelist[0] == 'zig' and arg in {'ar', 'cc', 'c++', 'dlltool', 'lib', 'ranlib', 'objcopy', 'rc'}:
+ return True
return arg.startswith('-')
def update_cmake_compiler_state(self) -> None: