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`.
@@ -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
