diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-02-14 10:05:42 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-02-17 20:22:34 +0200 |
commit | deff35eef60223b5df6497e61e0cdcf1ad81f09f (patch) | |
tree | 3f76df4a13d3b8dc4c43abe184c954e8896acae1 /mesonbuild/compilers.py | |
parent | 440d73902dc266ff25465d125b7f625e531b1225 (diff) | |
download | meson-deff35eef60223b5df6497e61e0cdcf1ad81f09f.zip meson-deff35eef60223b5df6497e61e0cdcf1ad81f09f.tar.gz meson-deff35eef60223b5df6497e61e0cdcf1ad81f09f.tar.bz2 |
Filter out UNIX flags from external deps when using the MSVC compiler
This is very useful to prevent compiler noise about invalid cflags; particularly
for the -mms-bitfields cflag which most libraries send to the mingw-gcc
compiler. More can be added later.
Diffstat (limited to 'mesonbuild/compilers.py')
-rw-r--r-- | mesonbuild/compilers.py | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py index cb6b7c7..7cf152f 100644 --- a/mesonbuild/compilers.py +++ b/mesonbuild/compilers.py @@ -184,7 +184,10 @@ class Compiler(): def has_function(self, *args, **kwargs): raise EnvironmentException('Language %s does not support function checks.' % self.language) - def unixtype_flags_to_native(self, args): + def unix_link_flags_to_native(self, args): + return args + + def unix_compile_flags_to_native(self, args): return args class CCompiler(Compiler): @@ -1174,7 +1177,7 @@ class VisualStudioCCompiler(CCompiler): def get_option_link_args(self, options): return options['c_winlibs'].value - def unixtype_flags_to_native(self, args): + def unix_link_flags_to_native(self, args): result = [] for i in args: if i.startswith('-L'): @@ -1182,6 +1185,15 @@ class VisualStudioCCompiler(CCompiler): result.append(i) return result + def unix_compile_flags_to_native(self, args): + result = [] + for i in args: + # -mms-bitfields is specific to MinGW-GCC + if i == '-mms-bitfields': + continue + result.append(i) + return result + def get_include_args(self, path, is_system): if path == '': path = '.' @@ -1799,7 +1811,10 @@ class VisualStudioLinker(): def get_option_link_args(self, options): return [] - def unixtype_flags_to_native(self, args): + def unix_link_flags_to_native(self, args): + return args + + def unix_compile_flags_to_native(self, args): return args class ArLinker(): @@ -1845,5 +1860,8 @@ class ArLinker(): def get_option_link_args(self, options): return [] - def unixtype_flags_to_native(self, args): + def unix_link_flags_to_native(self, args): + return args + + def unix_compile_flags_to_native(self, args): return args |