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.
pull/13756/head
Elliott Sales de Andrade 8 months ago committed by Dylan Baker
parent 4c3bb4f67b
commit eda59e141d
  1. 2
      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:

Loading…
Cancel
Save