build: Use Visual Studio-specific flags for AVX

Needed for now, but unstable-simd is likely a better fix for all our
SIMD building.
This commit is contained in:
Arun Raghavan 2023-12-15 09:34:15 -05:00
parent c6abf6cd3f
commit 06157f1659
3 changed files with 11 additions and 4 deletions

View File

@ -174,6 +174,13 @@ common_cxxflags = common_cflags
common_deps = os_deps + [absl_dep] common_deps = os_deps + [absl_dep]
webrtc_inc = include_directories('.') webrtc_inc = include_directories('.')
# FIXME: use the unstable-simd module instead
if cc.get_define('_MSC_VER') != ''
avx_flags = ['/arch:AVX2']
else
avx_flags = ['-mavx2', '-mfma']
endif
subdir('webrtc') subdir('webrtc')
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')

View File

@ -83,8 +83,8 @@ if have_x86
], ],
dependencies: common_deps, dependencies: common_deps,
include_directories: webrtc_inc, include_directories: webrtc_inc,
c_args: common_cflags + ['-mavx2', '-mfma'], c_args: common_cflags + avx_flags,
cpp_args: common_cxxflags + ['-mavx2', '-mfma'] cpp_args: common_cxxflags + avx_flags
) )
] ]
endif endif

View File

@ -177,8 +177,8 @@ if have_x86
], ],
dependencies: common_deps, dependencies: common_deps,
include_directories: webrtc_inc, include_directories: webrtc_inc,
c_args: common_cflags + apm_flags + ['-mavx2', '-mfma'], c_args: common_cflags + apm_flags + avx_flags,
cpp_args: common_cxxflags + apm_flags + ['-mavx2', '-mfma'] cpp_args: common_cxxflags + apm_flags + avx_flags
) )
] ]
endif endif