summaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorKO Myung-Hun <komh@chollian.net>2023-07-03 23:06:27 +0900
committerDylan Baker <dylan@pnwbakers.com>2025-11-14 08:16:23 -0800
commit7d118937c4b36650305a0e7da7f5cf642dd30e80 (patch)
treee333db264fcaf565cdfd0bdf6b4c5510369a8ebf /mesonbuild
parent4b58e349657ef386e4311dcc7552fc1c0ac2293f (diff)
downloadmeson-7d118937c4b36650305a0e7da7f5cf642dd30e80.tar.gz
Extension of the executable is `exe' on OS/2
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/backends.py2
-rw-r--r--mesonbuild/envconfig.py2
-rw-r--r--mesonbuild/programs.py5
3 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 7fba3f3fb..de41ea171 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -593,7 +593,7 @@ class Backend:
else:
if exe_cmd[0].endswith('.jar'):
exe_cmd = ['java', '-jar'] + exe_cmd
- elif exe_cmd[0].endswith('.exe') and not (mesonlib.is_windows() or mesonlib.is_cygwin() or mesonlib.is_wsl()):
+ elif exe_cmd[0].endswith('.exe') and not (mesonlib.is_windows() or mesonlib.is_cygwin() or mesonlib.is_wsl() or machine.is_os2()):
exe_cmd = ['mono'] + exe_cmd
exe_wrapper = None
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index 161ffff21..dd050b011 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -392,7 +392,7 @@ class MachineInfo(HoldableObject):
# static libraries, and executables.
# Versioning is added to these names in the backends as-needed.
def get_exe_suffix(self) -> str:
- if self.is_windows() or self.is_cygwin():
+ if self.is_windows() or self.is_cygwin() or self.is_os2():
return 'exe'
else:
return ''
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