vala: Add 'VALAFLAGS' to considered environment variables

Fix precedence of arguments for Vala tasks and include those considered
external (i.e. '-Dvala_args' and 'VALAFLAGS').
pull/1660/head
Guillaume Poirier-Morency 9 years ago committed by Jussi Pakkanen
parent 33b5ddf35e
commit aa486f5bb2
  1. 9
      mesonbuild/backend/ninjabackend.py
  2. 10
      mesonbuild/environment.py

@ -1060,10 +1060,15 @@ int dummy;
vala_c_src.append(vala_c_file)
valac_outputs.append(vala_c_file)
# TODO: Use self.generate_basic_compiler_args to get something more
# consistent Until then, we should be careful to preserve the
# precedence of arguments if it changes upstream.
args = []
args += self.build.get_global_args(valac)
args += self.build.get_project_args(valac, target.subproject)
args += valac.get_buildtype_args(self.get_option_for_target('buildtype', target))
args += self.build.get_project_args(valac, target.subproject)
args += self.build.get_global_args(valac)
args += self.environment.coredata.external_args[valac.get_language()]
# Tell Valac to output everything in our private directory. Sadly this
# means it will also preserve the directory components of Vala sources
# found inside the build tree (generated sources).

@ -809,16 +809,18 @@ def get_args_from_envvars(compiler):
if hasattr(compiler, 'get_linker_exelist'):
compiler_is_linker = (compiler.get_exelist() == compiler.get_linker_exelist())
if lang not in ('c', 'cpp', 'objc', 'objcpp', 'fortran', 'd'):
return [], [], []
# Compile flags
cflags_mapping = {'c': 'CFLAGS',
'cpp': 'CXXFLAGS',
'objc': 'OBJCFLAGS',
'objcpp': 'OBJCXXFLAGS',
'fortran': 'FFLAGS',
'd': 'DFLAGS'}
'd': 'DFLAGS',
'vala': 'VALAFLAGS'}
if lang not in cflags_mapping.keys():
return [], [], []
compile_flags = os.environ.get(cflags_mapping[lang], '')
log_var(cflags_mapping[lang], compile_flags)
compile_flags = shlex.split(compile_flags)

Loading…
Cancel
Save