diff --git a/CMakeLists.txt b/CMakeLists.txt index d256e7ed..0cf3c0f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,6 @@ INCLUDE (CheckLibraryExists) INCLUDE (CheckSymbolExists) include (CMakeDependentOption) include (GNUInstallDirs) -include (${CMAKE_MODULE_PATH}/platform.cmake) include (${CMAKE_MODULE_PATH}/boost.cmake) include (${CMAKE_MODULE_PATH}/ragel.cmake) @@ -123,6 +122,10 @@ if (RELEASE_BUILD) add_definitions(-DNDEBUG) endif() +# Architecture detection + +include (${CMAKE_MODULE_PATH}/platform.cmake) + # Detect OS and if Fat Runtime is available include (${CMAKE_MODULE_PATH}/osdetection.cmake) diff --git a/cmake/cflags-x86.cmake b/cmake/cflags-x86.cmake index 7b9cbf81..5ae21ee4 100644 --- a/cmake/cflags-x86.cmake +++ b/cmake/cflags-x86.cmake @@ -26,6 +26,9 @@ if (NOT FAT_RUNTIME) set(ARCH_CXX_FLAGS "-msse4.2") endif() else() + set(BUILD_AVX512VBMI ON) + set(BUILD_AVX512 ON) + set(BUILD_AVX2 ON) set(ARCH_C_FLAGS "-msse4.2") set(ARCH_CXX_FLAGS "-msse4.2") endif() @@ -129,5 +132,3 @@ else (NOT FAT_RUNTIME) message(FATAL_ERROR "A minimum of SSE4.2 compiler support is required") endif () endif () - - diff --git a/cmake/osdetection.cmake b/cmake/osdetection.cmake index 343e16b5..59f2b342 100644 --- a/cmake/osdetection.cmake +++ b/cmake/osdetection.cmake @@ -6,7 +6,12 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(FREEBSD true) endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") -option(FAT_RUNTIME "Build a library that supports multiple microarchitectures" OFF) +if (ARCH_IA32 OR ARCH_X86_64) + option(FAT_RUNTIME "Build a library that supports multiple microarchitectures" ON) +else() + option(FAT_RUNTIME "Build a library that supports multiple microarchitectures" OFF) +endif() + if (FAT_RUNTIME) message("Checking Fat Runtime Requirements...") if (NOT LINUX)