diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-02-16 10:48:20 -0800 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-02-17 14:46:15 +0200 |
commit | 10d94a12b85ba19dc2bcfc6296632eaf74f5d4f0 (patch) | |
tree | 5c3d1544f8870c004bcc7cb91adddfa2968363cd /mesonbuild/mesonlib/universal.py | |
parent | 7812ceec5fe6147bfe8a5a265b58db1282d2cabc (diff) | |
download | meson-10d94a12b85ba19dc2bcfc6296632eaf74f5d4f0.zip meson-10d94a12b85ba19dc2bcfc6296632eaf74f5d4f0.tar.gz meson-10d94a12b85ba19dc2bcfc6296632eaf74f5d4f0.tar.bz2 |
Environment: Fix passing envrionment variables CPPFLAGS and CFLAGS
Or other language flags that use CPPFLAGS (like CXXFLAGS). The problem
here is actually rather simple, `dict.setdefault()` doesn't work like I
thought it did, I thought it created a weak entry, but it actually is
equivalent to:
```python
if k not in dict:
dict[k] = v
```
Instead we'll use an intermediate dictionary (a default dictionary
actually, since that makes things a little cleaner) and then add the
keys from that dict to self.options as applicable.
Test case written by Jussi, Fix by Dylan
Co-authored-by: Jussi Pakkanen
Fixes: #8361
Fixes: #8345
Diffstat (limited to 'mesonbuild/mesonlib/universal.py')
-rw-r--r-- | mesonbuild/mesonlib/universal.py | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index 7deb24a..19e329d 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -2023,7 +2023,6 @@ class OptionKey: This takes strings like `mysubproject:build.myoption` and Creates an OptionKey out of them. """ - try: subproject, raw2 = raw.split(':') except ValueError: |