1 # Autodetect if SSE4.1 can be used. If so, the assumption is, so can the other
2 # SSE version (SSE 2.0, SSSE 3.0).
4 include(CheckCXXSourceCompiles)
5 set(CMAKE_REQUIRED_FLAGS "")
7 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
8 set(CMAKE_REQUIRED_FLAGS "-msse4.1")
11 check_cxx_source_compiles("
12 #include <xmmintrin.h>
13 #include <smmintrin.h>
14 #include <tmmintrin.h>
15 int main() { return 0; }"