aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-10-05 09:54:46 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-11-01 12:24:25 -0700
commitb572a7980ea3cbbc31ddc4fb012a9369bfb03ccb (patch)
tree7217cea059f5884743e8f50be5438efcb9faaa80 /mesonbuild/build.py
parenteafed4b8ad3ebbc56a1545e0b2e85bdef2bf0173 (diff)
downloadmeson-b572a7980ea3cbbc31ddc4fb012a9369bfb03ccb.zip
meson-b572a7980ea3cbbc31ddc4fb012a9369bfb03ccb.tar.gz
meson-b572a7980ea3cbbc31ddc4fb012a9369bfb03ccb.tar.bz2
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.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 12e25c5..1af2ae2 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