build: use inheritance properly for is_internal

Calling `isinstance(self, X)` is an anti-pattern, we should just be using
inheritance for this, letting the `StaticLibrary` override the method, and
having the base class always return `False`.
pull/10473/head
Dylan Baker 3 years ago committed by Jussi Pakkanen
parent f235b814c3
commit 629a9c68e2
  1. 5
      mesonbuild/build.py

@ -1398,7 +1398,7 @@ You probably should put it in link_with instead.''')
return self.external_deps
def is_internal(self) -> bool:
return isinstance(self, StaticLibrary) and not self.need_install
return False
def link(self, target):
for t in listify(target):
@ -2002,6 +2002,9 @@ class StaticLibrary(BuildTarget):
def is_linkable_target(self):
return True
def is_internal(self) -> bool:
return not self.need_install
class SharedLibrary(BuildTarget):
known_kwargs = known_shlib_kwargs

Loading…
Cancel
Save