diff options
Diffstat (limited to 'mesonbuild/programs.py')
| -rw-r--r-- | mesonbuild/programs.py | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
