From 091452f8cd886dedc2bc5d3ec292dcf899989a24 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 11 May 2018 09:14:18 -0700 Subject: modules/python3: allow specifying in the native file --- mesonbuild/modules/python3.py | 5 ++++- mesonbuild/modules/windows.py | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py index 5bda5ab..f664632 100644 --- a/mesonbuild/modules/python3.py +++ b/mesonbuild/modules/python3.py @@ -48,7 +48,10 @@ class Python3Module(ExtensionModule): @noKwargs def find_python(self, state, args, kwargs): - py3 = dependencies.ExternalProgram('python3', mesonlib.python_command, silent=True) + options = [state.environment.config_info.binaries.get('python3')] + if not options[0]: # because this would be [None] + options = ['python3', mesonlib.python_command] + py3 = dependencies.ExternalProgram(*options, silent=True) return ModuleReturnValue(py3, [py3]) @noKwargs diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index 96f3a7e..d185d89 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -62,9 +62,8 @@ class WindowsModule(ExtensionModule): # Take windres from the config file after the environment, which is # in keeping with the expectations on unix-like OSes that # environment variables trump config files. - _win = state.environment.config_info.binaries.get('windres') - if _win: - rescomp = ExternalProgram('windres', command=_win, silent=True) + bins = state.environment.config_info.binaries + rescomp = ExternalProgram.from_bin_list(bins, 'windres') if not rescomp or not rescomp.found(): comp = self.detect_compiler(state.compilers) -- cgit v1.1