aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/coredata.py
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-02-04 17:33:14 -0500
committerDylan Baker <dylan@pnwbakers.com>2019-02-15 09:17:24 -0800
commit9d7f38eccdf8efddda9126d2a4f361db1cf08ab7 (patch)
tree9f1e587cdd4197894e1700c5052fee7f531e72d3 /mesonbuild/coredata.py
parentd87744138ac72df23ecce950909ac89c1f0decc7 (diff)
downloadmeson-9d7f38eccdf8efddda9126d2a4f361db1cf08ab7.zip
meson-9d7f38eccdf8efddda9126d2a4f361db1cf08ab7.tar.gz
meson-9d7f38eccdf8efddda9126d2a4f361db1cf08ab7.tar.bz2
Fix cross file initialization of CPPFLAGS
'c_arg' entries should become *both* compiler options and external peprocessor options for C. (And likewise for a few other languages.) Seems inconsistent to me, but this is the status quo.
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r--mesonbuild/coredata.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index 139dd6e..a026584 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -20,7 +20,7 @@ from pathlib import PurePath
from collections import OrderedDict
from .mesonlib import (
MesonException, MachineChoice, PerMachine,
- default_libdir, default_libexecdir, default_prefix
+ default_libdir, default_libexecdir, default_prefix, stringlistify
)
from .wrap import WrapMode
import ast
@@ -600,6 +600,12 @@ class CoreData:
# Unlike compiler and linker flags, preprocessor flags are not in
# compiler_options because they are not visible to user.
preproc_flags = shlex.split(preproc_flags)
+ k = lang + '_args'
+ if lang in ('c', 'cpp', 'objc', 'objcpp') and k in env.properties[for_machine]:
+ # `c_args` in the cross file are used, like CPPFLAGS but *not*
+ # CFLAGS, for tests. this is weird, but how it was already
+ # implemented. Hopefully a new version of #3916 fixes it.
+ preproc_flags = stringlistify(env.properties[for_machine][k])
self.external_preprocess_args[for_machine].setdefault(lang, preproc_flags)
enabled_opts = []