aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/coredata.py
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-03-19 17:58:46 -0400
committerNirbheek Chauhan <nirbheek.chauhan@gmail.com>2019-03-27 14:45:42 +0000
commite677704d2149db9ac91c5000633a3fac8f91956f (patch)
treedf27968a4780819eecc56a2b8415e0e1c2476665 /mesonbuild/coredata.py
parent151961056cc2ebda27244746d4d441b2eb48cf8e (diff)
downloadmeson-e677704d2149db9ac91c5000633a3fac8f91956f.zip
meson-e677704d2149db9ac91c5000633a3fac8f91956f.tar.gz
meson-e677704d2149db9ac91c5000633a3fac8f91956f.tar.bz2
Don't collect preprocssor flags separately from compiler flags
I recall that @jpakkane never wanted this, but @nirbheek did, but then @nirbheek changed his mind. I am fine either way except for the cross inconsistency that exists today: There is no `c_preproc_args` or similar one can put in the cross file, so no way to replicate the effect of CPPFLAGS during cross compilation.
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r--mesonbuild/coredata.py24
1 files changed, 3 insertions, 21 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index cb50961..b5f48bd 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -264,7 +264,6 @@ class CoreData:
self.user_options = {}
self.compiler_options = PerMachine({}, {}, {})
self.base_options = {}
- self.external_preprocess_args = PerMachine({}, {}, {}) # CPPFLAGS only
self.cross_files = self.__load_config_files(options.cross_file)
self.compilers = OrderedDict()
self.cross_compilers = OrderedDict()
@@ -446,9 +445,6 @@ class CoreData:
def get_external_link_args(self, for_machine: MachineChoice, lang):
return self.compiler_options[for_machine][lang + '_link_args'].value
- def get_external_preprocess_args(self, for_machine: MachineChoice, lang):
- return self.external_preprocess_args[for_machine][lang]
-
def merge_user_options(self, options):
for (name, value) in options.items():
if name not in self.user_options:
@@ -532,21 +528,18 @@ class CoreData:
# Native compiler always exist so always add its options.
new_options_for_build = comp.get_and_default_options(env.properties.build)
- preproc_flags_for_build = comp.get_preproc_flags()
if cross_comp is not None:
new_options_for_host = cross_comp.get_and_default_options(env.properties.host)
- preproc_flags_for_host = cross_comp.get_preproc_flags()
else:
new_options_for_host = comp.get_and_default_options(env.properties.host)
- preproc_flags_for_host = comp.get_preproc_flags()
opts_machines_list = [
- (new_options_for_build, preproc_flags_for_build, MachineChoice.BUILD),
- (new_options_for_host, preproc_flags_for_host, MachineChoice.HOST),
+ (new_options_for_build, MachineChoice.BUILD),
+ (new_options_for_host, MachineChoice.HOST),
]
optprefix = lang + '_'
- for new_options, preproc_flags, for_machine in opts_machines_list:
+ for new_options, for_machine in opts_machines_list:
for k, o in new_options.items():
if not k.startswith(optprefix):
raise MesonException('Internal error, %s has incorrect prefix.' % k)
@@ -556,17 +549,6 @@ class CoreData:
o.set_value(env.cmd_line_options[k])
self.compiler_options[for_machine].setdefault(k, o)
- # 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 = []
for optname in comp.base_options:
if optname in self.base_options: