diff options
author | Martin Storsjö <martin@martin.st> | 2020-12-15 12:51:33 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-12-15 11:46:17 -0800 |
commit | c9685ac5612eb040961efe5dc60a91fc5aa686b4 (patch) | |
tree | 4759fb807381493f07ffcd4f52488d63dd69a197 | |
parent | 521a1b9921b712bdea7498b927e16f06c19a828c (diff) | |
download | meson-c9685ac5612eb040961efe5dc60a91fc5aa686b4.zip meson-c9685ac5612eb040961efe5dc60a91fc5aa686b4.tar.gz meson-c9685ac5612eb040961efe5dc60a91fc5aa686b4.tar.bz2 |
Fix the subsystem options for lld in mingw mode
lld in gnu like mode (e.g. for mingw) needs these options in
the same for as gnu ld, thus remove the lld specific code bit
and move the code for gnu like options into GnuLikeDynamicLinkerMixin.
This unbreaks linking with lld for mingw targets after
2fb4d1f7512a4ec125883fd65115ab33a5b06b6f.
-rw-r--r-- | mesonbuild/linkers.py | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index fcc280c..e74457b 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -668,6 +668,18 @@ class GnuLikeDynamicLinkerMixin: return (args, rpath_dirs_to_remove) + def get_win_subsystem_args(self, value: str) -> T.List[str]: + if 'windows' in value: + args = ['--subsystem,windows'] + elif 'console' in value: + args = ['--subsystem,console'] + else: + raise mesonlib.MesonException(f'Only "windows" and "console" are supported for win_subsystem with MinGW, not "{value}".') + if ',' in value: + args[-1] = args[-1] + ':' + value.split(',')[1] + + return self._apply_prefix(args) + class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): @@ -752,18 +764,6 @@ class GnuDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dynam """Representation of GNU ld.bfd and ld.gold.""" - def get_win_subsystem_args(self, value: str) -> T.List[str]: - if 'windows' in value: - args = ['--subsystem,windows'] - elif 'console' in value: - args = ['--subsystem,console'] - else: - raise mesonlib.MesonException(f'Only "windows" and "console" are supported for win_subsystem with MinGW, not "{value}".') - if ',' in value: - args[-1] = args[-1] + ':' + value.split(',')[1] - - return self._apply_prefix(args) - def get_accepts_rsp(self) -> bool: return True @@ -802,9 +802,6 @@ class LLVMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, Dyna return self._apply_prefix('--allow-shlib-undefined') return [] - def get_win_subsystem_args(self, value: str) -> T.List[str]: - return self._apply_prefix([f'-subsystem:{value}']) - class WASMDynamicLinker(GnuLikeDynamicLinkerMixin, PosixDynamicLinkerMixin, DynamicLinker): |