From 7d118937c4b36650305a0e7da7f5cf642dd30e80 Mon Sep 17 00:00:00 2001 From: KO Myung-Hun Date: Mon, 3 Jul 2023 23:06:27 +0900 Subject: Extension of the executable is `exe' on OS/2 --- mesonbuild/programs.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'mesonbuild/programs.py') diff --git a/mesonbuild/programs.py b/mesonbuild/programs.py index 0abf09720..a1cfc06e9 100644 --- a/mesonbuild/programs.py +++ b/mesonbuild/programs.py @@ -322,6 +322,11 @@ class ExternalProgram(mesonlib.HoldableObject): paths = OrderedSet(path.split(os.pathsep)).difference(exclude_paths) path = os.pathsep.join(paths) command = shutil.which(name, path=path) + if not command and mesonlib.is_os2(): + for ext in ['exe', 'cmd']: + command = shutil.which(f'{name}.{ext}', path=path) + if command: + return [command] if mesonlib.is_windows(): return self._search_windows_special_cases(name, command, exclude_paths) # On UNIX-like platforms, shutil.which() is enough to find -- cgit v1.2.3