From 5b58ff2783dbd6b8cdc002385ec6daba717f4856 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Mon, 26 Jun 2017 19:50:41 -0400 Subject: [PATCH 1/2] compilers: Use 'get_display_language' for language-related exceptions --- mesonbuild/compilers/compilers.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 232109337..a200c0759 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -622,28 +622,28 @@ class Compiler: return [] def has_header(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support header checks.' % self.language) + raise EnvironmentException('Language %s does not support header checks.' % self.get_display_language()) def has_header_symbol(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support header symbol checks.' % self.language) + raise EnvironmentException('Language %s does not support header symbol checks.' % self.get_display_language()) def compiles(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support compile checks.' % self.language) + raise EnvironmentException('Language %s does not support compile checks.' % self.get_display_language()) def links(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support link checks.' % self.language) + raise EnvironmentException('Language %s does not support link checks.' % self.get_display_language()) def run(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support run checks.' % self.language) + raise EnvironmentException('Language %s does not support run checks.' % self.get_display_language()) def sizeof(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support sizeof checks.' % self.language) + raise EnvironmentException('Language %s does not support sizeof checks.' % self.get_display_language()) def alignment(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support alignment checks.' % self.language) + raise EnvironmentException('Language %s does not support alignment checks.' % self.get_display_language()) def has_function(self, *args, **kwargs): - raise EnvironmentException('Language %s does not support function checks.' % self.language) + raise EnvironmentException('Language %s does not support function checks.' % self.get_display_language()) @classmethod def unix_args_to_native(cls, args): @@ -651,7 +651,7 @@ class Compiler: return args[:] def find_library(self, *args, **kwargs): - raise EnvironmentException('Language {} does not support library finding.'.format(self.language)) + raise EnvironmentException('Language {} does not support library finding.'.format(self.get_display_language())) def get_library_dirs(self): return [] @@ -662,7 +662,7 @@ class Compiler: def has_multi_arguments(self, args, env): raise EnvironmentException( 'Language {} does not support has_multi_arguments.'.format( - self.language)) + self.get_display_language())) def get_cross_extra_flags(self, environment, link): extra_flags = [] @@ -753,7 +753,7 @@ class Compiler: def get_link_whole_for(self, args): if isinstance(args, list) and not args: return [] - raise EnvironmentException('Language %s does not support linking whole archives.' % self.language) + raise EnvironmentException('Language %s does not support linking whole archives.' % self.get_display_language()) def build_unix_rpath_args(self, build_dir, from_dir, rpath_paths, install_rpath): if not rpath_paths and not install_rpath: From bbddf51a5425799564e7c8ede4456feb59537357 Mon Sep 17 00:00:00 2001 From: Guillaume Poirier-Morency Date: Mon, 26 Jun 2017 19:52:04 -0400 Subject: [PATCH 2/2] Use 'C sharp' instead of 'C#' The '#' is reserved for Ninja comments and cannot be escaped. --- mesonbuild/compilers/cs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py index 4f6fec12a..e6c5b9e49 100644 --- a/mesonbuild/compilers/cs.py +++ b/mesonbuild/compilers/cs.py @@ -26,7 +26,7 @@ class MonoCompiler(Compiler): self.monorunner = 'mono' def get_display_language(self): - return 'C#' + return 'C sharp' def get_output_args(self, fname): return ['-out:' + fname]