diff options
| author | KO Myung-Hun <komh@chollian.net> | 2023-11-08 22:08:54 +0900 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2025-11-14 08:16:23 -0800 |
| commit | 9d26b9713931ffe67c1b7ec79eb1e8c03839fd89 (patch) | |
| tree | 077682f75e750557d8bbe3bcda3d82ff68bb7af3 /mesonbuild/compilers/detect.py | |
| parent | 6b87395b15a16a353ca28ad641dc7ff71de5f1e6 (diff) | |
| download | meson-9d26b9713931ffe67c1b7ec79eb1e8c03839fd89.tar.gz | |
Add `os2_emxomf' option to generate OMF files on OS/2
1. Generate OMF objs with `-Zomf' compiler flags
2. Generate OMF libs with `.lib' suffix using `emxomfar' as a librarian
Diffstat (limited to 'mesonbuild/compilers/detect.py')
| -rw-r--r-- | mesonbuild/compilers/detect.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 2dbeac04a..bf72d347c 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -80,6 +80,7 @@ defaults['clang_cl_static_linker'] = ['llvm-lib'] defaults['cuda_static_linker'] = ['nvlink'] defaults['gcc_static_linker'] = ['gcc-ar'] defaults['clang_static_linker'] = ['llvm-ar'] +defaults['emxomf_static_linker'] = ['emxomfar'] defaults['nasm'] = ['nasm', 'yasm'] @@ -158,6 +159,7 @@ def _handle_exceptions( def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker: from . import d from ..linkers import linkers + from ..options import OptionKey linker = env.lookup_binary_entry(compiler.for_machine, 'ar') if linker is not None: trials = [linker] @@ -167,6 +169,8 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker trials = [defaults['cuda_static_linker']] + default_linkers elif compiler.get_argument_syntax() == 'msvc': trials = [defaults['vs_static_linker'], defaults['clang_cl_static_linker']] + elif env.machines[compiler.for_machine].is_os2() and env.coredata.optstore.get_value_for(OptionKey('os2_emxomf')): + trials = [defaults['emxomf_static_linker']] + default_linkers elif compiler.id == 'gcc': # Use gcc-ar if available; needed for LTO trials = [defaults['gcc_static_linker']] + default_linkers @@ -256,6 +260,8 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker return linkers.AIXArLinker(linker) if p.returncode == 1 and err.startswith('ar: bad option: --'): # Solaris return linkers.ArLinker(compiler.for_machine, linker) + if p.returncode == 1 and err.startswith('emxomfar'): + return linkers.EmxomfArLinker(compiler.for_machine, linker) _handle_exceptions(popen_exceptions, trials, 'linker') raise EnvironmentException('Unreachable code (exception to make mypy happy)') |
