diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py index 89d5d84449e0..7d73a7cea014 100644 --- a/mesonbuild/cmake/toolchain.py +++ b/mesonbuild/cmake/toolchain.py @@ -198,6 +198,8 @@ def is_cmdline_option(compiler: 'Compiler', arg: str) -> bool: 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: