diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2018-09-18 10:28:14 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2018-11-14 15:57:37 -0800 |
commit | 95403cb61520978c52b3693a9bf0119e8348c20b (patch) | |
tree | aff931dbdd7241075d5f52c9a1bd24f5c05e63dd /mesonbuild | |
parent | 5a9c9c70df17c8f1ba900933574586c46c3d096f (diff) | |
download | meson-95403cb61520978c52b3693a9bf0119e8348c20b.zip meson-95403cb61520978c52b3693a9bf0119e8348c20b.tar.gz meson-95403cb61520978c52b3693a9bf0119e8348c20b.tar.bz2 |
replace ExternalProgram.from_cross_info with from_bin_list
This more generic method will also be used to check a config file for
binary information.
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/dependencies/base.py | 9 | ||||
-rw-r--r-- | mesonbuild/dependencies/ui.py | 2 | ||||
-rw-r--r-- | mesonbuild/environment.py | 3 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/windows.py | 4 |
5 files changed, 11 insertions, 9 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index e67f4c0..a7e2980 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -500,7 +500,8 @@ class PkgConfigDependency(ExternalDependency): if self.required: raise DependencyException('Pkg-config binary missing from cross file') else: - potential_pkgbin = ExternalProgram.from_cross_info(environment.cross_info, 'pkgconfig') + potential_pkgbin = ExternalProgram.from_bin_list( + environment.cross_info.config['binaries'], 'pkgconfig') if potential_pkgbin.found(): self.pkgbin = potential_pkgbin else: @@ -1076,10 +1077,10 @@ class ExternalProgram: return ' '.join(self.command) @staticmethod - def from_cross_info(cross_info, name): - if name not in cross_info.config['binaries']: + def from_bin_list(bins, name): + if name not in bins: return NonExistingExternalProgram() - command = cross_info.config['binaries'][name] + command = bins[name] if not isinstance(command, (list, str)): raise MesonException('Invalid type {!r} for binary {!r} in cross file' ''.format(command, name)) diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index e3b371d..ae05673 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -303,7 +303,7 @@ class QtBaseDependency(ExternalDependency): # Even when cross-compiling, if a cross-info qmake is not specified, we # fallback to using the qmake in PATH because that's what we used to do if self.env.is_cross_build() and 'qmake' in self.env.cross_info.config['binaries']: - return ExternalProgram.from_cross_info(self.env.cross_info, 'qmake') + return ExternalProgram.from_bin_list(self.env.cross_info.config['binaries'], 'qmake') return ExternalProgram(qmake, silent=True) def _qmake_detect(self, mods, kwargs): diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 80917ed..073825a 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -340,7 +340,8 @@ class Environment: self.cross_info = CrossBuildInfo(self.coredata.cross_file) if 'exe_wrapper' in self.cross_info.config['binaries']: from .dependencies import ExternalProgram - self.exe_wrapper = ExternalProgram.from_cross_info(self.cross_info, 'exe_wrapper') + self.exe_wrapper = ExternalProgram.from_bin_list( + self.cross_info.config['binaries'], 'exe_wrapper') if 'host_machine' in self.cross_info.config: self.machines.host = MachineInfo.from_literal( self.cross_info.config['host_machine']) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index d7a5b66..73c21fd 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2757,7 +2757,7 @@ external dependencies (including libraries) must go to "dependencies".''') continue # Always points to a local (i.e. self generated) file. if not isinstance(p, str): raise InterpreterException('Executable name must be a string') - prog = ExternalProgram.from_cross_info(cross_info, p) + prog = ExternalProgram.from_bin_list(bins, p) if prog.found(): return ExternalProgramHolder(prog) return None diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index 4d0f244..85cc3bc 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -49,8 +49,8 @@ class WindowsModule(ExtensionModule): if state.environment.is_cross_build(): # If cross compiling see if windres has been specified in the # cross file before trying to find it another way. - cross_info = state.environment.cross_info - rescomp = ExternalProgram.from_cross_info(cross_info, 'windres') + bins = state.environment.cross_info.config['binaries'] + rescomp = ExternalProgram.from_bin_list(bins, 'windres') if not rescomp or not rescomp.found(): if 'WINDRES' in os.environ: |