Skip to content

Commit

Permalink
[opus] Limit runtime AVX2 detection to MSVC and always enable AVX2 fo…
Browse files Browse the repository at this point in the history
…r AVX2/AVX512 builds
  • Loading branch information
starg2 committed Mar 16, 2024
1 parent 25ec8dc commit e2f9bf5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions opus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,26 @@ add_definitions(
-DOPUS_BUILD
-DFLOAT_APPROX
-DDLL_EXPORT
-DOPUS_HAVE_RTCD
-DOPUS_X86_MAY_HAVE_SSE
-DOPUS_X86_MAY_HAVE_SSE2
-DOPUS_X86_MAY_HAVE_SSE4_1
-DOPUS_X86_MAY_HAVE_AVX2
-DOPUS_X86_PRESUME_SSE
-DOPUS_X86_PRESUME_SSE2
-DOPUS_X86_PRESUME_SSE4_1
)

if("${TIM41_X86_SIMD_LEVEL}" MATCHES "^(AVX2|AVX512)$")
add_definitions(
-DOPUS_X86_MAY_HAVE_AVX2
-DOPUS_X86_PRESUME_AVX2
)
elseif(MSVC)
add_definitions(
-DOPUS_HAVE_RTCD
-DOPUS_X86_MAY_HAVE_AVX2
)
endif()

add_library(
opus SHARED

Expand Down

0 comments on commit e2f9bf5

Please sign in to comment.