diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-03-10 10:52:50 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-05-25 22:41:03 -0400 |
commit | a6df51aa8c2031aff181a2ad5bc5f0f5b60a44bb (patch) | |
tree | b285a1aca1d0fc01abda5f3ac8f867c42aee9e20 /mesonbuild/build.py | |
parent | 8f68f5435dfbb2f476aaa7927399e16fdc80422e (diff) | |
download | meson-a6df51aa8c2031aff181a2ad5bc5f0f5b60a44bb.zip meson-a6df51aa8c2031aff181a2ad5bc5f0f5b60a44bb.tar.gz meson-a6df51aa8c2031aff181a2ad5bc5f0f5b60a44bb.tar.bz2 |
build: replace hand rolled code with CustomTarget[Index].links_dynamically()
Which also fixes builds on windows that might produce a .lib instead of
a .a. The error message has been changed to reflect that as well
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 550b5e4..d64b772 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1418,8 +1418,8 @@ You probably should put it in link_with instead.''') if isinstance(t, (CustomTarget, CustomTargetIndex)): if not t.is_linkable_target(): raise InvalidArguments(f'Custom target {t!r} is not linkable.') - if not t.get_filename().endswith('.a'): - raise InvalidArguments('Can only link_whole custom targets that are .a archives.') + if t.links_dynamically(): + raise InvalidArguments('Can only link_whole custom targets that are static archives.') if isinstance(self, StaticLibrary): # FIXME: We could extract the .a archive to get object files raise InvalidArguments('Cannot link_whole a custom target into a static library') |