diff options
author | Rechi <Rechi@users.noreply.github.com> | 2017-03-22 15:22:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-22 15:22:51 +0100 |
commit | f8ce7d81b8306f1d85624996678a60bb8b567859 (patch) | |
tree | d629bc41eb3e93910f5eed5eb626de3aba14667b | |
parent | a4435900a5bfb1777e2dd30de1783d81ae595f4f (diff) | |
parent | 68693823bdc7740d0b54192cc18275f96ed64c89 (diff) |
Merge pull request #11888 from Rechi/fixBuildAndroidX86
[cmake] Fix compiling of Android-X86 after 742cc3c31b by checking SSE support again
-rw-r--r-- | cmake/modules/FindSSE.cmake | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cmake/modules/FindSSE.cmake b/cmake/modules/FindSSE.cmake index ba9fb541ed..d001b03376 100644 --- a/cmake/modules/FindSSE.cmake +++ b/cmake/modules/FindSSE.cmake @@ -40,6 +40,22 @@ if(CMAKE_SYSTEM_NAME MATCHES "Linux") string(COMPARE EQUAL "avx2" "${_SSE_THERE}" _AVX2_TRUE) CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) endif() +elseif(CMAKE_SYSTEM_NAME MATCHES "Android") + if(CPU MATCHES "x86_64" OR CPU MATCHES "i.86") + set(_SSE_TRUE TRUE) + set(_SSE2_TRUE TRUE) + set(_SSE3_TRUE TRUE) + set(_SSSE3_TRUE TRUE) + + CHECK_CXX_ACCEPTS_FLAG("-msse" _SSE_OK) + CHECK_CXX_ACCEPTS_FLAG("-msse2" _SSE2_OK) + CHECK_CXX_ACCEPTS_FLAG("-msse3" _SSE3_OK) + CHECK_CXX_ACCEPTS_FLAG("-mssse3" _SSSE3_OK) + CHECK_CXX_ACCEPTS_FLAG("-msse4.1" _SSE41_OK) + CHECK_CXX_ACCEPTS_FLAG("-msse4.2" _SSE42_OK) + CHECK_CXX_ACCEPTS_FLAG("-mavx" _AVX_OK) + CHECK_CXX_ACCEPTS_FLAG("-mavx2" _AVX2_OK) + endif() elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT CPU MATCHES "arm") exec_program("/usr/sbin/sysctl -n machdep.cpu.features machdep.cpu.leaf7_features" OUTPUT_VARIABLE CPUINFO) |