diff options
| author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2024-03-10 23:26:02 -0400 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-10-04 08:57:11 -0700 |
| commit | eda59e141d30204908ef1f56b2637164310c9ccc (patch) | |
| tree | db990d7b9d207d96d49321b7ab238ac34b7ece04 /mesonbuild/cmake/toolchain.py | |
| parent | 4c3bb4f67b49359a1f3f1441ad4a736f78266f5f (diff) | |
| download | meson-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.
Diffstat (limited to 'mesonbuild/cmake/toolchain.py')
| -rw-r--r-- | mesonbuild/cmake/toolchain.py | 2 |
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: |
