diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-21 09:50:36 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-04-02 08:44:37 -0700 |
| commit | 2c10d77c3c7b2b9ad3464ef37bc6eb01fb34deb0 (patch) | |
| tree | 97ea5b2d1a35055aa4421d8f068d710a79b6e032 /mesonbuild/cmake/toolchain.py | |
| parent | dfefd838a846dd944d8a3f91200b6c54f0ffd198 (diff) | |
| download | meson-2c10d77c3c7b2b9ad3464ef37bc6eb01fb34deb0.tar.gz | |
compilers: introduce get_exe() and get_exe_args()
This will be used by rustdoc tests because the Test objects takes a
single string for the command and everything else goes in the args.
But apart from this, the need to split the executable from the
arguments is common so create new methods to do it.
While at it, fix brokenness in the handling of the zig compiler, which
is checking against "zig" but failing to detect e.g. "/usr/bin/zig".
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/cmake/toolchain.py')
| -rw-r--r-- | mesonbuild/cmake/toolchain.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py index 9eb961c52..d410886ec 100644 --- a/mesonbuild/cmake/toolchain.py +++ b/mesonbuild/cmake/toolchain.py @@ -9,6 +9,7 @@ from ..envconfig import CMakeSkipCompilerTest from .common import language_map, cmake_get_generator_args from .. import mlog +import os.path import shutil import typing as T from enum import Enum @@ -198,7 +199,7 @@ 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'}: + if os.path.basename(compiler.get_exe()) == 'zig' and arg in {'ar', 'cc', 'c++', 'dlltool', 'lib', 'ranlib', 'objcopy', 'rc'}: return True return arg.startswith('-') |
