diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2021-03-07 19:28:39 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2021-03-07 19:28:39 +0300 |
commit | 639829ea1a5e17c48a64429336004a96b3e2e1c0 (patch) | |
tree | 4f379216aa2c96cec5fc44b42a477ddaf692eb32 /CMakeLists.txt | |
parent | 0ef5c14de0413dd6b81b94338d70079513da1a48 (diff) | |
parent | 9c8382e6186b519429e4dee8870265351810bc99 (diff) |
Merge branch 'master' into tmp-vulkan
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7dd1a6cd879..ae8fc500e33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -904,6 +904,18 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Release") endif() endif() +# Test SIMD support, before platform includes to determine if sse2neon is needed. +if(WITH_CPU_SIMD) + set(COMPILER_SSE_FLAG) + set(COMPILER_SSE2_FLAG) + + # Test Neon first since macOS Arm can compile and run x86-64 SSE binaries. + TEST_NEON_SUPPORT() + if(NOT SUPPORT_NEON_BUILD) + TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG) + endif() +endif() + # ---------------------------------------------------------------------------- # Main Platform Checks # @@ -959,16 +971,11 @@ if(WITH_INTERNATIONAL) endif() endif() -# See TEST_SSE_SUPPORT() and TEST_NEON_SUPPORT() for how these are defined. +# Enable SIMD support if detected by TEST_SSE_SUPPORT() or TEST_NEON_SUPPORT(). # # This is done globally, so that all modules can use it if available, and # because these are used in headers used by many modules. if(WITH_CPU_SIMD) - set(COMPILER_SSE_FLAG) - set(COMPILER_SSE2_FLAG) - - # Test Neon first since macOS Arm can compile and run x86-64 SSE binaries. - TEST_NEON_SUPPORT() if(SUPPORT_NEON_BUILD) # Neon if(SSE2NEON_FOUND) @@ -977,7 +984,6 @@ if(WITH_CPU_SIMD) endif() else() # SSE - TEST_SSE_SUPPORT(COMPILER_SSE_FLAG COMPILER_SSE2_FLAG) if(SUPPORT_SSE_BUILD) string(PREPEND PLATFORM_CFLAGS "${COMPILER_SSE_FLAG} ") add_definitions(-D__SSE__ -D__MMX__) |