Vala: enable colored warning and error output (#2142)
This commit is contained in:
parent
ece4ce8872
commit
0ed0bcce49
|
@ -1094,6 +1094,7 @@ int dummy;
|
|||
valac_outputs.append(vala_c_file)
|
||||
|
||||
args = self.generate_basic_compiler_args(target, valac)
|
||||
args += valac.get_colorout_args(self.environment.coredata.base_options.get('b_colorout').value)
|
||||
# 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).
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
import os.path
|
||||
|
||||
from .. import mlog
|
||||
from ..mesonlib import EnvironmentException
|
||||
from ..mesonlib import EnvironmentException, version_compare
|
||||
|
||||
from .compilers import Compiler
|
||||
|
||||
|
@ -26,6 +26,7 @@ class ValaCompiler(Compiler):
|
|||
self.version = version
|
||||
self.id = 'valac'
|
||||
self.is_cross = False
|
||||
self.base_options = ['b_colorout']
|
||||
|
||||
def name_string(self):
|
||||
return ' '.join(self.exelist)
|
||||
|
@ -54,6 +55,11 @@ class ValaCompiler(Compiler):
|
|||
def get_werror_args(self):
|
||||
return ['--fatal-warnings']
|
||||
|
||||
def get_colorout_args(self, colortype):
|
||||
if version_compare(self.version, '>=0.37.1'):
|
||||
return ['--color=' + colortype]
|
||||
return []
|
||||
|
||||
def sanity_check(self, work_dir, environment):
|
||||
code = 'class MesonSanityCheck : Object { }'
|
||||
args = self.get_cross_extra_flags(environment, link=False)
|
||||
|
|
Loading…
Reference in New Issue