Remove premature return in BuildTarget.check_module_linking()

We want to loop over all link_targets to update
backwards_compat_want_soname if necessary.

Fixes: ec9bdc6edb
pull/9622/merge
Mike Gilbert 3 years ago committed by Jussi Pakkanen
parent c2956269f5
commit 91a099f3a7
  1. 3
      mesonbuild/build.py

@ -1588,7 +1588,7 @@ You probably should put it in link_with instead.''')
Warn if shared modules are linked with target: (link_with) #2865 Warn if shared modules are linked with target: (link_with) #2865
''' '''
for link_target in self.link_targets: for link_target in self.link_targets:
if isinstance(link_target, SharedModule): if isinstance(link_target, SharedModule) and not link_target.backwards_compat_want_soname:
if self.environment.machines[self.for_machine].is_darwin(): if self.environment.machines[self.for_machine].is_darwin():
raise MesonException( raise MesonException(
f'target {self.name} links against shared module {link_target.name}. This is not permitted on OSX') f'target {self.name} links against shared module {link_target.name}. This is not permitted on OSX')
@ -1601,7 +1601,6 @@ You probably should put it in link_with instead.''')
'\n ' '\n '
'use shared_libary() with `override_options: [\'b_lundef=false\']` instead.') 'use shared_libary() with `override_options: [\'b_lundef=false\']` instead.')
link_target.backwards_compat_want_soname = True link_target.backwards_compat_want_soname = True
return
class Generator(HoldableObject): class Generator(HoldableObject):
def __init__(self, exe: T.Union['Executable', programs.ExternalProgram], def __init__(self, exe: T.Union['Executable', programs.ExternalProgram],

Loading…
Cancel
Save