8
is_windows = host_machine.system() == 'windows'
9
is_msvc = meson.get_compiler('c').get_id() == 'msvc'
10
cpu_family = host_machine.cpu_family()
12
blake3_x86_no_simd_defs = ['-DBLAKE3_NO_SSE2', '-DBLAKE3_NO_SSE41', '-DBLAKE3_NO_AVX2', '-DBLAKE3_NO_AVX512']
14
if cpu_family == 'x86_64'
17
# An up-to-date version of Meson, not using the VS backend is needed.
18
# See https://github.com/mesonbuild/meson/issues/11653
19
if meson.backend() == 'ninja' and add_languages('masm', required : false)
20
files_blake3 += ['blake3_sse2_x86-64_windows_msvc.masm', 'blake3_sse41_x86-64_windows_msvc.masm', 'blake3_avx2_x86-64_windows_msvc.masm', 'blake3_avx512_x86-64_windows_msvc.masm']
22
blake3_defs += blake3_x86_no_simd_defs
25
files_blake3 += ['blake3_sse2_x86-64_windows_gnu.S', 'blake3_sse41_x86-64_windows_gnu.S', 'blake3_avx2_x86-64_windows_gnu.S', 'blake3_avx512_x86-64_windows_gnu.S']
28
files_blake3 += ['blake3_sse2_x86-64_unix.S', 'blake3_sse41_x86-64_unix.S', 'blake3_avx2_x86-64_unix.S', 'blake3_avx512_x86-64_unix.S']
30
elif cpu_family == 'x86'
31
# There are no assembly versions for 32-bit x86. Compiling the C versions require a different compilation flag per
32
# file, which is not well supported by Meson. Leave SIMD support out for now.
33
blake3_defs += blake3_x86_no_simd_defs
34
elif cpu_family == 'aarch64'
35
files_blake3 += ['blake3_neon.c']
38
blake3 = static_library(
42
gnu_symbol_visibility : 'hidden',
45
idep_blake3 = declare_dependency(