diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-07-28 12:05:09 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-08-10 16:06:45 +0530 |
commit | 79fd83eac84387950547fb5c4d26a525b2d6aed8 (patch) | |
tree | f8ed94c56cf062f33b522d40230c210e1474e38e | |
parent | 47825f378aeea0e6c7c853987a496e0be7892c1a (diff) | |
download | meson-79fd83eac84387950547fb5c4d26a525b2d6aed8.zip meson-79fd83eac84387950547fb5c4d26a525b2d6aed8.tar.gz meson-79fd83eac84387950547fb5c4d26a525b2d6aed8.tar.bz2 |
build: store global and project args per-machine even when not cross compiling
The problem is what happens in this case:
```meson
add_project_arguments('-DHOST', language : 'c', native : false)
add_project_arguments('-DBUILD', langauge : 'c', native : true)
```
The original meson behavior was that in an host == build configuration
only the `native : false` would be applied. This doesn't really make
sense as in that case the build machine is the host machine, so it is
both the native and non-native machine at once. We changed this so that
the both would be applied in a host == build configuration, but this is
a behavioral change, and needs to be reverted.
Fixes: #9037
-rw-r--r-- | mesonbuild/build.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 6fc0373..846de8d 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -212,14 +212,10 @@ class Build: self.projects = {} self.targets: T.MutableMapping[str, 'Target'] = OrderedDict() self.run_target_names: T.Set[T.Tuple[str, str]] = set() - self.global_args: PerMachine[T.Dict[str, T.List[str]]] = PerMachineDefaultable.default( - environment.is_cross_build(), {}, {}) - self.global_link_args: PerMachine[T.Dict[str, T.List[str]]] = PerMachineDefaultable.default( - environment.is_cross_build(), {}, {}) - self.projects_args: PerMachine[T.Dict[str, T.Dict[str, T.List[str]]]] = PerMachineDefaultable.default( - environment.is_cross_build(), {}, {}) - self.projects_link_args: PerMachine[T.Dict[str, T.Dict[str, T.List[str]]]] = PerMachineDefaultable.default( - environment.is_cross_build(), {}, {}) + self.global_args: PerMachine[T.Dict[str, T.List[str]]] = PerMachine({}, {}) + self.global_link_args: PerMachine[T.Dict[str, T.List[str]]] = PerMachine({}, {}) + self.projects_args: PerMachine[T.Dict[str, T.Dict[str, T.List[str]]]] = PerMachine({}, {}) + self.projects_link_args: PerMachine[T.Dict[str, T.Dict[str, T.List[str]]]] = PerMachine({}, {}) self.tests: T.List['Test'] = [] self.benchmarks: T.List['Test'] = [] self.headers: T.List[Headers] = [] |