summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/compilers/detect.py4
-rw-r--r--test cases/nasm/2 asm language/meson.build13
2 files changed, 9 insertions, 8 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 8644d75c0..849024cf4 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -1151,6 +1151,10 @@ def detect_nasm_compiler(env: 'Environment', for_machine: MachineChoice) -> Comp
popen_exceptions: T.Dict[str, Exception] = {}
for comp in compilers:
+ if comp == ['nasm'] and is_windows() and not shutil.which(comp[0]):
+ # nasm is not in PATH on Windows by default
+ default_path = os.path.join(os.environ['ProgramFiles'], 'NASM')
+ comp[0] = shutil.which(comp[0], path=default_path) or comp[0]
try:
output = Popen_safe(comp + ['--version'])[1]
except OSError as e:
diff --git a/test cases/nasm/2 asm language/meson.build b/test cases/nasm/2 asm language/meson.build
index ced2ded62..e1ef10a76 100644
--- a/test cases/nasm/2 asm language/meson.build
+++ b/test cases/nasm/2 asm language/meson.build
@@ -1,18 +1,15 @@
project('test', 'c')
-nasm = find_program('nasm', required: false)
-yasm = find_program('yasm', required: false)
-if not nasm.found() and not yasm.found()
- assert(not add_languages('nasm', required: false))
- error('MESON_SKIP_TEST: nasm not available')
-endif
-
if not host_machine.cpu_family().startswith('x86')
assert(not add_languages('nasm', required: false))
error('MESON_SKIP_TEST: nasm only supported for x86 and x86_64')
endif
-add_languages('nasm')
+if not add_languages('nasm', required: false)
+ nasm = find_program('nasm', 'yasm', required: false)
+ assert(not nasm.found())
+ error('MESON_SKIP_TEST: nasm not found')
+endif
config_file = configure_file(
output: 'config.asm',