mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
Add x86 CPU check in meson.build for clang build fix
have_avx = cc.has_argument(avx_args) gcc generates an error when AVX is unsupported, whereas clang only produces a warning. Thus, using Clang on the RISC-V platform incorrectly enables AVX file compilation, leading to build failures.
This commit is contained in:
parent
1af1fc846c
commit
60981494d6
1 changed files with 23 additions and 14 deletions
37
meson.build
37
meson.build
|
|
@ -127,21 +127,30 @@ if have_cpp
|
||||||
add_project_arguments(cxx.get_supported_arguments(cxx_flags), language: 'cpp')
|
add_project_arguments(cxx.get_supported_arguments(cxx_flags), language: 'cpp')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sse_args = '-msse'
|
have_sse = false
|
||||||
sse2_args = '-msse2'
|
have_sse2 = false
|
||||||
ssse3_args = '-mssse3'
|
have_ssse3 = false
|
||||||
sse41_args = '-msse4.1'
|
have_sse41 = false
|
||||||
fma_args = '-mfma'
|
have_fma = false
|
||||||
avx_args = '-mavx'
|
have_avx = false
|
||||||
avx2_args = '-mavx2'
|
have_avx2 = false
|
||||||
|
if host_machine.cpu_family() in ['x86', 'x86_64']
|
||||||
|
sse_args = '-msse'
|
||||||
|
sse2_args = '-msse2'
|
||||||
|
ssse3_args = '-mssse3'
|
||||||
|
sse41_args = '-msse4.1'
|
||||||
|
fma_args = '-mfma'
|
||||||
|
avx_args = '-mavx'
|
||||||
|
avx2_args = '-mavx2'
|
||||||
|
|
||||||
have_sse = cc.has_argument(sse_args)
|
have_sse = cc.has_argument(sse_args)
|
||||||
have_sse2 = cc.has_argument(sse2_args)
|
have_sse2 = cc.has_argument(sse2_args)
|
||||||
have_ssse3 = cc.has_argument(ssse3_args)
|
have_ssse3 = cc.has_argument(ssse3_args)
|
||||||
have_sse41 = cc.has_argument(sse41_args)
|
have_sse41 = cc.has_argument(sse41_args)
|
||||||
have_fma = cc.has_argument(fma_args)
|
have_fma = cc.has_argument(fma_args)
|
||||||
have_avx = cc.has_argument(avx_args)
|
have_avx = cc.has_argument(avx_args)
|
||||||
have_avx2 = cc.has_argument(avx2_args)
|
have_avx2 = cc.has_argument(avx2_args)
|
||||||
|
endif
|
||||||
|
|
||||||
have_neon = false
|
have_neon = false
|
||||||
if host_machine.cpu_family() == 'aarch64'
|
if host_machine.cpu_family() == 'aarch64'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue