Create a new configuration data object and return it as the result.
This commit is contained in:
parent
fe86c9c399
commit
6119beed4d
|
@ -46,11 +46,8 @@ class SimdModule(ExtensionModule):
|
|||
compiler = kwargs['compiler'].compiler
|
||||
if not isinstance(compiler, compilers.Compiler):
|
||||
raise mesonlib.MesonException('Compiler argument must be a compiler object.')
|
||||
if 'configuration' not in kwargs:
|
||||
raise mesonlib.MesonException('Must specify configuration object.')
|
||||
conf = kwargs['configuration'].held_object
|
||||
if not isinstance(conf, build.ConfigurationData):
|
||||
raise mesonlib.MesonException('Configuration must be a configuration object.')
|
||||
cdata = interpreter.func_configuration_data(None, [], {})
|
||||
conf = cdata.held_object
|
||||
for iset in self.isets:
|
||||
if iset not in kwargs:
|
||||
continue
|
||||
|
@ -69,7 +66,7 @@ class SimdModule(ExtensionModule):
|
|||
lib_kwargs = {'sources': iset_fname,
|
||||
compiler.get_language() + '_args': args}
|
||||
result.append(interpreter.func_static_lib(None, [libname], lib_kwargs))
|
||||
return result
|
||||
return [result, cdata]
|
||||
|
||||
def initialize():
|
||||
return SimdModule()
|
||||
|
|
|
@ -4,8 +4,6 @@ simd = import('simd')
|
|||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
cdata = configuration_data()
|
||||
|
||||
if not meson.is_cross_build() and host_machine.cpu_family() == 'arm' and cc.get_id() == 'clang'
|
||||
message('Adding -march=armv7 because assuming that this build happens on Raspbian.')
|
||||
message('Its Clang seems to be misconfigured and does not support NEON by default.')
|
||||
|
@ -16,7 +14,8 @@ if cc.get_id() == 'msvc' and cc.version().version_compare('<17')
|
|||
error('MESON_SKIP_TEST VS2010 produces broken binaries on x86.')
|
||||
endif
|
||||
|
||||
simdlibs = simd.check('mysimds',
|
||||
# FIXME add [a, b] = function()
|
||||
rval = simd.check('mysimds',
|
||||
mmx : 'simd_mmx.c',
|
||||
sse : 'simd_sse.c',
|
||||
sse2 : 'simd_sse2.c',
|
||||
|
@ -27,9 +26,11 @@ simdlibs = simd.check('mysimds',
|
|||
avx : 'simd_avx.c',
|
||||
avx2 : 'simd_avx2.c',
|
||||
neon : 'simd_neon.c',
|
||||
configuration : cdata,
|
||||
compiler : cc)
|
||||
|
||||
simdlibs = rval[0]
|
||||
# FIXME add cdata1.merge_from(cdata2)
|
||||
cdata = rval[1]
|
||||
|
||||
configure_file(output : 'simdconfig.h',
|
||||
configuration : cdata)
|
||||
|
|
Loading…
Reference in New Issue