aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-08-09 16:06:55 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-01-02 16:22:47 -0500
commit2b22576fb6a8bb52434068d95eff188a201e6bc5 (patch)
treeb169c0c8c5cf56f68cf8a1d75f35a0fb71ad295f /mesonbuild/modules
parentdbf080afe99a8bbb04a3bfb19a81363d3b78e7b4 (diff)
downloadmeson-2b22576fb6a8bb52434068d95eff188a201e6bc5.zip
meson-2b22576fb6a8bb52434068d95eff188a201e6bc5.tar.gz
meson-2b22576fb6a8bb52434068d95eff188a201e6bc5.tar.bz2
Remove cross_info; cross file is parsed up front and discarded
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/gnome.py8
-rw-r--r--mesonbuild/modules/python.py9
-rw-r--r--mesonbuild/modules/python3.py9
-rw-r--r--mesonbuild/modules/windows.py22
4 files changed, 15 insertions, 33 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index be99059..2ab575c 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -532,7 +532,7 @@ class GnomeModule(ExtensionModule):
for lang in langs:
if state.environment.is_cross_build():
- link_args = state.environment.cross_info.config["properties"].get(lang + '_link_args', "")
+ link_args = state.environment.properties.host.get_external_link_args(lang)
else:
link_args = state.environment.coredata.get_external_link_args(lang)
@@ -715,7 +715,7 @@ class GnomeModule(ExtensionModule):
ret = []
for lang in langs:
if state.environment.is_cross_build():
- ret += state.environment.cross_info.config["properties"].get(lang + '_args', "")
+ ret += state.environment.properties.host.get_external_args(lang)
else:
ret += state.environment.coredata.get_external_args(lang)
return ret
@@ -1043,8 +1043,8 @@ This will become a hard error in the future.''')
ldflags.update(external_ldflags)
if state.environment.is_cross_build():
- cflags.update(state.environment.cross_info.config["properties"].get('c_args', ""))
- ldflags.update(state.environment.cross_info.config["properties"].get('c_link_args', ""))
+ cflags.update(state.environment.properties.host.get_external_args('c'))
+ ldflags.update(state.environment.properties.host.get_external_link_args('c'))
compiler = state.environment.coredata.cross_compilers.get('c')
else:
cflags.update(state.environment.coredata.get_external_args('c'))
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
index 9643ebc..c14ac85 100644
--- a/mesonbuild/modules/python.py
+++ b/mesonbuild/modules/python.py
@@ -501,20 +501,17 @@ class PythonModule(ExtensionModule):
if len(args) > 1:
raise InvalidArguments('find_installation takes zero or one positional argument.')
- if 'python' in state.environment.config_info.binaries:
- name_or_path = state.environment.config_info.binaries['python']
- elif args:
+ name_or_path = state.environment.binaries.host.lookup_entry('python')
+ if name_or_path is None and args:
name_or_path = args[0]
if not isinstance(name_or_path, str):
raise InvalidArguments('find_installation argument must be a string.')
- else:
- name_or_path = None
if not name_or_path:
mlog.log("Using meson's python {}".format(mesonlib.python_command))
python = ExternalProgram('python3', mesonlib.python_command, silent=True)
else:
- python = ExternalProgram(name_or_path, silent = True)
+ python = ExternalProgram.from_entry('python3', name_or_path)
if not python.found() and mesonlib.is_windows():
pythonpath = self._get_win_pythonpath(name_or_path)
diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py
index f664632..46f15f0 100644
--- a/mesonbuild/modules/python3.py
+++ b/mesonbuild/modules/python3.py
@@ -48,10 +48,11 @@ class Python3Module(ExtensionModule):
@noKwargs
def find_python(self, state, args, kwargs):
- 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)
+ command = state.environment.binaries.host.lookup_entry('python3')
+ if command is not None:
+ py3 = dependencies.ExternalProgram.from_entry('python3', command)
+ else:
+ py3 = dependencies.ExternalProgram('python3', mesonlib.python_command, silent=True)
return ModuleReturnValue(py3, [py3])
@noKwargs
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py
index d185d89..e8d266e 100644
--- a/mesonbuild/modules/windows.py
+++ b/mesonbuild/modules/windows.py
@@ -41,29 +41,13 @@ class WindowsModule(ExtensionModule):
def _find_resource_compiler(self, state):
# FIXME: Does not handle `native: true` executables, see
# See https://github.com/mesonbuild/meson/issues/1531
+ # But given a machine, we can un-hardcode `binaries.host` below.
if hasattr(self, '_rescomp'):
return self._rescomp
- rescomp = None
- 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.
- 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:
- # Pick-up env var WINDRES if set. This is often used for
- # specifying an arch-specific windres.
- rescomp = ExternalProgram('windres', command=os.environ.get('WINDRES'), silent=True)
-
- if not rescomp or not rescomp.found():
- # 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.
- bins = state.environment.config_info.binaries
- rescomp = ExternalProgram.from_bin_list(bins, 'windres')
+ # Will try cross / native file and then env var
+ rescomp = ExternalProgram.from_bin_list(state.environment.binaries.host, 'windres')
if not rescomp or not rescomp.found():
comp = self.detect_compiler(state.compilers)