summaryrefslogtreecommitdiff
path: root/mesonbuild/programs.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2024-09-26 15:00:54 +0530
committerDylan Baker <dylan@pnwbakers.com>2024-09-30 10:17:41 -0700
commitfb4995a2c607b8289ae97a3faa5917f2887da294 (patch)
tree73dd2dae3a905a0d967f8ffd264dce331e988c3b /mesonbuild/programs.py
parent9294c81fc134515a7b7d06ed538b66f45993b59d (diff)
downloadmeson-fb4995a2c607b8289ae97a3faa5917f2887da294.tar.gz
programs: Store the project version when overriding find_program
When we're using the output of configure_file() with override_find_program(), we weren't storing the version anywhere, so get_version() was trying to run the script during setup. This is usually fine, except in cases where the configure_file() script actually has to import a library built as part of the project, and fails to run. For built executables, we simply use the project version, and we now do the same here too.
Diffstat (limited to 'mesonbuild/programs.py')
-rw-r--r--mesonbuild/programs.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mesonbuild/programs.py b/mesonbuild/programs.py
index 8f7d1c36c..bbe8ea421 100644
--- a/mesonbuild/programs.py
+++ b/mesonbuild/programs.py
@@ -340,6 +340,12 @@ class OverrideProgram(ExternalProgram):
"""A script overriding a program."""
+ def __init__(self, name: str, version: str, command: T.Optional[T.List[str]] = None,
+ silent: bool = False, search_dir: T.Optional[str] = None,
+ extra_search_dirs: T.Optional[T.List[str]] = None):
+ self.cached_version = version
+ super().__init__(name, command=command, silent=silent,
+ search_dir=search_dir, extra_search_dirs=extra_search_dirs)
def find_external_program(env: 'Environment', for_machine: MachineChoice, name: str,
display_name: str, default_names: T.List[str],