From 42ee56445941d506ae0a040e8f1b2359aa8088ef Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 5 Apr 2021 10:33:24 -0700 Subject: [PATCH] environment: simplify handling of native files with no cross files Instead of treating native files as always being for the build machine, and then copying them to the host machine, treat them as for the build machine only when a cross file is also present --- mesonbuild/environment.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index a0d54f6e5..6b822fe85 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -640,7 +640,9 @@ class Environment: binaries.build = BinaryTable(config.get('binaries', {})) properties.build = Properties(config.get('properties', {})) cmakevars.build = CMakeVariables(config.get('cmake', {})) - self._load_machine_file_options(config, properties.build, MachineChoice.BUILD) + self._load_machine_file_options( + config, properties.build, + MachineChoice.BUILD if self.coredata.cross_files else MachineChoice.HOST) ## Read in cross file(s) to override host machine configuration @@ -659,12 +661,6 @@ class Environment: if self.coredata.is_per_machine_option(key): self.options[key.as_build()] = value self._load_machine_file_options(config, properties.host, MachineChoice.HOST) - else: - # If we aren't cross compiling, but we have a native file, the - # native file is for the host. This is due to an mismatch between - # meson internals which talk about build an host, and external - # interfaces which talk about native and cross. - self.options = {k.as_host(): v for k, v in self.options.items()} ## "freeze" now initialized configuration, and "save" to the class.