diff options
author | John Ericson <git@JohnEricson.me> | 2018-12-12 00:19:03 -0500 |
---|---|---|
committer | John Ericson <git@JohnEricson.me> | 2019-02-02 13:59:14 -0500 |
commit | 19f81d3e33c70c9c902dabaad732e5d33bf05bd4 (patch) | |
tree | f86664395d7233bbba9e3c129c81c7056c6fa98b /mesonbuild/modules/gnome.py | |
parent | 6dbe33d949237411b1291c30f5383885befb3554 (diff) | |
download | meson-19f81d3e33c70c9c902dabaad732e5d33bf05bd4.zip meson-19f81d3e33c70c9c902dabaad732e5d33bf05bd4.tar.gz meson-19f81d3e33c70c9c902dabaad732e5d33bf05bd4.tar.bz2 |
Never access environment.properties downstream
Instead use coredata.compiler_options.<machine>. This brings the cross
and native code paths closer together, since both now use that.
Command line options are interpreted just as before, for backwards
compatibility. This does introduce some funny conditionals. In the
future, I'd like to change the interpretation of command line options so
- The logic is cross-agnostic, i.e. there are no conditions affected by
`is_cross_build()`.
- Compiler args for both the build and host machines can always be
controlled by the command line.
- Compiler args for both machines can always be controlled separately.
Diffstat (limited to 'mesonbuild/modules/gnome.py')
-rw-r--r-- | mesonbuild/modules/gnome.py | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 871cd48..2d16956 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -29,7 +29,9 @@ from . import GResourceTarget, GResourceHeaderTarget, GirTarget, TypelibTarget, from . import get_include_args from . import ExtensionModule from . import ModuleReturnValue -from ..mesonlib import MesonException, OrderedSet, Popen_safe, extract_as_list +from ..mesonlib import ( + MachineChoice, MesonException, OrderedSet, Popen_safe, extract_as_list +) from ..dependencies import Dependency, PkgConfigDependency, InternalDependency from ..interpreterbase import noKwargs, permittedKwargs, FeatureNew, FeatureNewKwargs @@ -531,11 +533,7 @@ class GnomeModule(ExtensionModule): ret = [] for lang in langs: - if state.environment.is_cross_build(): - link_args = state.environment.properties.host.get_external_link_args(lang) - else: - link_args = state.environment.coredata.get_external_link_args(lang) - + link_args = state.environment.coredata.get_external_link_args(MachineChoice.HOST, lang) for link_arg in link_args: if link_arg.startswith('-L'): ret.append(link_arg) @@ -720,10 +718,7 @@ class GnomeModule(ExtensionModule): def _get_external_args_for_langs(self, state, langs): ret = [] for lang in langs: - if state.environment.is_cross_build(): - ret += state.environment.properties.host.get_external_args(lang) - else: - ret += state.environment.coredata.get_external_args(lang) + ret += state.environment.coredata.get_external_args(MachineChoice.HOST, lang) return ret @staticmethod @@ -1048,13 +1043,11 @@ This will become a hard error in the future.''') ldflags.update(internal_ldflags) ldflags.update(external_ldflags) + cflags.update(state.environment.coredata.get_external_args(MachineChoice.HOST, 'c')) + ldflags.update(state.environment.coredata.get_external_link_args(MachineChoice.HOST, 'c')) if state.environment.is_cross_build(): - 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')) - ldflags.update(state.environment.coredata.get_external_link_args('c')) compiler = state.environment.coredata.compilers.get('c') compiler_flags = self._get_langs_compilers_flags(state, [('c', compiler)]) |