Fix exception when linking with invalid object.

If you declare_dependency(link_with : 'string'), an exception is
supposed to be raised, but instead of a proper message, it's an
exception about a missing attribute.
pull/1214/merge
Elliott Sales de Andrade 8 years ago committed by Jussi Pakkanen
parent a2528a8816
commit c7f788e184
  1. 2
      mesonbuild/build.py

@ -748,7 +748,7 @@ class BuildTarget():
if hasattr(t, 'held_object'):
t = t.held_object
if not isinstance(t, (StaticLibrary, SharedLibrary)):
raise InvalidArguments('Link target {!r} is not library.'.format(t.name))
raise InvalidArguments('Link target {!r} is not library.'.format(t))
if isinstance(self, SharedLibrary) and isinstance(t, StaticLibrary) and not t.pic:
msg = "Can't link non-PIC static library {!r} into shared library {!r}. ".format(t.name, self.name)
msg += "Use the 'pic' option to static_library to build with PIC."

Loading…
Cancel
Save