Put buildtype flags to vala compiles.

pull/493/merge
Jussi Pakkanen 9 years ago
parent 3415c3a693
commit 6291fb4056
  1. 5
      mesonbuild/backend/ninjabackend.py
  2. 7
      mesonbuild/compilers.py
  3. 8
      mesonbuild/environment.py

@ -184,7 +184,9 @@ int dummy;
self.generate_tests(outfile) self.generate_tests(outfile)
outfile.write('# Install rules\n\n') outfile.write('# Install rules\n\n')
self.generate_install(outfile) self.generate_install(outfile)
if self.environment.coredata.base_options.get('b_coverage', False): if 'b_coverage' in self.environment.coredata.base_options and\
self.environment.coredata.base_options['b_coverage'].value:
print(bool(self.environment.coredata.base_options.get('b_coverage', False)))
outfile.write('# Coverage rules\n\n') outfile.write('# Coverage rules\n\n')
self.generate_coverage_rules(outfile) self.generate_coverage_rules(outfile)
outfile.write('# Suffix\n\n') outfile.write('# Suffix\n\n')
@ -813,6 +815,7 @@ int dummy;
outputs = [vapiname] outputs = [vapiname]
args = [] args = []
args += self.build.get_global_args(compiler) args += self.build.get_global_args(compiler)
args += compiler.get_buildtype_args(self.environment.coredata.get_builtin_option('buildtype'))
args += ['-d', self.get_target_private_dir(target)] args += ['-d', self.get_target_private_dir(target)]
args += ['-C']#, '-o', cname] args += ['-C']#, '-o', cname]
if not isinstance(target, build.Executable): if not isinstance(target, build.Executable):

@ -126,7 +126,7 @@ base_options = {
'off'), 'off'),
'b_coverage': coredata.UserBooleanOption('b_coverage', 'b_coverage': coredata.UserBooleanOption('b_coverage',
'Enable coverage tracking.', 'Enable coverage tracking.',
True), False),
} }
def sanitizer_compile_args(value): def sanitizer_compile_args(value):
@ -1044,6 +1044,11 @@ class ValaCompiler(Compiler):
suffix = filename.split('.')[-1] suffix = filename.split('.')[-1]
return suffix in ('vala', 'vapi') return suffix in ('vala', 'vapi')
def get_buildtype_args(self, buildtype):
if buildtype == 'debug' or buildtype == 'debugoptimized':
return ['--debug']
return []
class RustCompiler(Compiler): class RustCompiler(Compiler):
def __init__(self, exelist, version): def __init__(self, exelist, version):
super().__init__(exelist, version) super().__init__(exelist, version)

@ -251,11 +251,11 @@ class Environment():
for compiler in compilers: for compiler in compilers:
for arg in ['--version', '-V']: for arg in ['--version', '-V']:
try: try:
p = subprocess.Popen([compiler] + [arg], p = subprocess.Popen([compiler] + [arg],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
except OSError: except OSError:
continue continue
(out, err) = p.communicate() (out, err) = p.communicate()
out = out.decode(errors='ignore') out = out.decode(errors='ignore')
err = err.decode(errors='ignore') err = err.decode(errors='ignore')

Loading…
Cancel
Save