diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-10-13 23:38:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-13 23:38:51 +0300 |
commit | 3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a (patch) | |
tree | e0af9977e708170d136104e4eb056b6f9f31eda0 /mesonbuild/environment.py | |
parent | 55cf399ff8b9c15300f26dd1a46045dda7d49f98 (diff) | |
parent | f5c9bf96b370832fc1a6e50771e2c171de0cd79d (diff) | |
download | meson-3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a.zip meson-3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a.tar.gz meson-3372c58ca633e2bc7d5b36bcd7e0d14d12e0f82a.tar.bz2 |
Merge pull request #7816 from mensinda/cmCross
cmake: Cross compilation support
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r-- | mesonbuild/environment.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py index 33cc3a5..394ef6a 100644 --- a/mesonbuild/environment.py +++ b/mesonbuild/environment.py @@ -30,6 +30,7 @@ from . import mlog from .envconfig import ( BinaryTable, MachineInfo, Properties, known_cpu_families, get_env_var_pair, + CMakeVariables, ) from . import compilers from .compilers import ( @@ -569,14 +570,17 @@ class Environment: # Stores machine infos, the only *three* machine one because we have a # target machine info on for the user (Meson never cares about the # target machine.) - machines = PerThreeMachineDefaultable() + machines = PerThreeMachineDefaultable() # type: PerMachineDefaultable[MachineInfo] # Similar to coredata.compilers, but lower level in that there is no # meta data, only names/paths. - binaries = PerMachineDefaultable() + binaries = PerMachineDefaultable() # type: PerMachineDefaultable[BinaryTable] # Misc other properties about each machine. - properties = PerMachineDefaultable() + properties = PerMachineDefaultable() # type: PerMachineDefaultable[Properties] + + # CMake toolchain variables + cmakevars = PerMachineDefaultable() # type: PerMachineDefaultable[CMakeVariables] # We only need one of these as project options are not per machine user_options = collections.defaultdict(dict) # type: T.DefaultDict[str, T.Dict[str, object]] @@ -653,6 +657,7 @@ class Environment: config = coredata.parse_machine_files(self.coredata.config_files) binaries.build = BinaryTable(config.get('binaries', {})) properties.build = Properties(config.get('properties', {})) + cmakevars.build = CMakeVariables(config.get('cmake', {})) # Don't run this if there are any cross files, we don't want to use # the native values if we're doing a cross build @@ -674,6 +679,7 @@ class Environment: config = coredata.parse_machine_files(self.coredata.cross_files) properties.host = Properties(config.get('properties', {})) binaries.host = BinaryTable(config.get('binaries', {})) + cmakevars.host = CMakeVariables(config.get('cmake', {})) if 'host_machine' in config: machines.host = MachineInfo.from_literal(config['host_machine']) if 'target_machine' in config: @@ -694,6 +700,7 @@ class Environment: self.machines = machines.default_missing() self.binaries = binaries.default_missing() self.properties = properties.default_missing() + self.cmakevars = cmakevars.default_missing() self.user_options = user_options self.meson_options = meson_options.default_missing() self.base_options = _base_options |