diff options
author | Guillaume Poirier-Morency <guillaumepoiriermorency@gmail.com> | 2017-06-24 20:16:30 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-06-26 14:15:44 -0400 |
commit | fab5634916191816ddecf1a2a958fa7ed2eac1ec (patch) | |
tree | 57a26181a852bf30e377fdd8d20d7a43626db993 /mesonbuild/compilers | |
parent | ce9cd33f27e8605c2d7fc77c3c2f086b6ac530ae (diff) | |
download | meson-fab5634916191816ddecf1a2a958fa7ed2eac1ec.zip meson-fab5634916191816ddecf1a2a958fa7ed2eac1ec.tar.gz meson-fab5634916191816ddecf1a2a958fa7ed2eac1ec.tar.bz2 |
Add 'Compiler.get_display_language'
Use this when we print language-related information to the console and
via the Ninja backend.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/c.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/cpp.py | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/cs.py | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/objc.py | 3 | ||||
-rw-r--r-- | mesonbuild/compilers/objcpp.py | 3 |
6 files changed, 16 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index c164ccd..cf9d1ee 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -179,7 +179,7 @@ class CCompiler(Compiler): return ['-Wl,--out-implib=' + implibname] def sanity_check_impl(self, work_dir, environment, sname, code): - mlog.debug('Sanity testing ' + self.language + ' compiler:', ' '.join(self.exelist)) + mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist)) mlog.debug('Is cross compiler: %s.' % str(self.is_cross)) extra_flags = [] diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 3d54986..2321093 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -584,6 +584,9 @@ class Compiler: def get_language(self): return self.language + def get_display_language(self): + return self.language.capitalize() + def get_default_suffix(self): return self.default_suffix diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 6d50e57..01525b0 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -32,6 +32,9 @@ class CPPCompiler(CCompiler): self.language = 'cpp' CCompiler.__init__(self, exelist, version, is_cross, exe_wrap) + def get_display_language(self): + return 'C++' + def get_no_stdinc_args(self): return ['-nostdinc++'] diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index c65a539..4f6fec1 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -25,6 +25,9 @@ class MonoCompiler(Compiler): self.id = 'mono' self.monorunner = 'mono' + def get_display_language(self): + return 'C#' + def get_output_args(self, fname): return ['-out:' + fname] diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py index b011c81..388e83b 100644 --- a/mesonbuild/compilers/objc.py +++ b/mesonbuild/compilers/objc.py @@ -24,6 +24,9 @@ class ObjCCompiler(CCompiler): self.language = 'objc' CCompiler.__init__(self, exelist, version, is_cross, exe_wrap) + def get_display_language(self): + return 'Objective-C' + def sanity_check(self, work_dir, environment): # TODO try to use sanity_check_impl instead of duplicated code source_name = os.path.join(work_dir, 'sanitycheckobjc.m') diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index b181f9a..c2e4647 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -24,6 +24,9 @@ class ObjCPPCompiler(CPPCompiler): self.language = 'objcpp' CPPCompiler.__init__(self, exelist, version, is_cross, exe_wrap) + def get_display_language(self): + return 'Objective-C++' + def sanity_check(self, work_dir, environment): # TODO try to use sanity_check_impl instead of duplicated code source_name = os.path.join(work_dir, 'sanitycheckobjcpp.mm') |