diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-03 17:30:40 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-04 12:55:24 +0300 |
commit | cad6bf32f121fc6584800e3a85fa341b8b7c1b04 (patch) | |
tree | a747881d4fd929418e93339f864aa21f5aa57834 /mesonbuild/modules/unstable_simd.py | |
parent | d335a84b9e91bb03bb99a296a5ecf084b325e6ce (diff) | |
download | meson-cad6bf32f121fc6584800e3a85fa341b8b7c1b04.zip meson-cad6bf32f121fc6584800e3a85fa341b8b7c1b04.tar.gz meson-cad6bf32f121fc6584800e3a85fa341b8b7c1b04.tar.bz2 |
Can pass all target kwargs through to SIMD invocations. Closes #2151.
Diffstat (limited to 'mesonbuild/modules/unstable_simd.py')
-rw-r--r-- | mesonbuild/modules/unstable_simd.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mesonbuild/modules/unstable_simd.py b/mesonbuild/modules/unstable_simd.py index 4aebc02..828afec 100644 --- a/mesonbuild/modules/unstable_simd.py +++ b/mesonbuild/modules/unstable_simd.py @@ -43,6 +43,12 @@ class SimdModule(ExtensionModule): raise mesonlib.MesonException('Argument must be a string.') if 'compiler' not in kwargs: raise mesonlib.MesonException('Must specify compiler keyword') + if 'sources' in kwargs: + raise mesonlib.MesonException('SIMD module does not support the "sources" keyword') + basic_kwargs = {} + for key, value in kwargs.items(): + if key not in self.isets and key != 'compiler': + basic_kwargs[key] = value compiler = kwargs['compiler'].compiler if not isinstance(compiler, compilers.compilers.Compiler): raise mesonlib.MesonException('Compiler argument must be a compiler object.') @@ -64,7 +70,14 @@ class SimdModule(ExtensionModule): conf.values['HAVE_' + iset.upper()] = ('1', 'Compiler supports %s.' % iset) libname = prefix + '_' + iset lib_kwargs = {'sources': iset_fname, - compiler.get_language() + '_args': args} + } + lib_kwargs.update(basic_kwargs) + langarg_key = compiler.get_language() + '_args' + old_lang_args = lib_kwargs.get(langarg_key, []) + if not isinstance(old_lang_args, list): + old_lang_args = [old_lang_args] + all_lang_args = old_lang_args + args + lib_kwargs[langarg_key] = all_lang_args result.append(interpreter.func_static_lib(None, [libname], lib_kwargs)) return [result, cdata] |