From b572a7980ea3cbbc31ddc4fb012a9369bfb03ccb Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 5 Oct 2021 09:54:46 -0700 Subject: [PATCH] build: Add a get_command method to Executable Since Executable can be used in places where ExternalProgram is, simply having a wrapper that gives them the same API is pretty useful. --- mesonbuild/build.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 12e25c5aa..1af2ae276 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1857,6 +1857,13 @@ class Executable(BuildTarget): def is_linkable_target(self): return self.is_linkwithable + def get_command(self) -> 'ImmutableListProtocol[str]': + """Provides compatibility with ExternalProgram. + + Since you can override ExternalProgram instances with Executables. + """ + return self.outputs + class StaticLibrary(BuildTarget): known_kwargs = known_stlib_kwargs