From 5e4a1edb0c420ad11ccf3fef0589b5fdba5dc204 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Mon, 9 Oct 2023 00:42:39 +0300 Subject: [PATCH] fix x86 fat binary build --- cmake/cflags-x86.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/cflags-x86.cmake b/cmake/cflags-x86.cmake index 95485ba7..7b9cbf81 100644 --- a/cmake/cflags-x86.cmake +++ b/cmake/cflags-x86.cmake @@ -66,6 +66,7 @@ int main() { }" HAVE_SSE42) # now look for AVX2 +set(CMAKE_REQUIRED_FLAGS "-mavx2") CHECK_C_SOURCE_COMPILES("#include <${INTRIN_INC_H}> #if !defined(__AVX2__) #error no avx2 @@ -77,6 +78,7 @@ int main(){ }" HAVE_AVX2) # and now for AVX512 +set(CMAKE_REQUIRED_FLAGS "${SKYLAKE_FLAG}") CHECK_C_SOURCE_COMPILES("#include <${INTRIN_INC_H}> #if !defined(__AVX512BW__) #error no avx512bw @@ -88,6 +90,7 @@ int main(){ }" HAVE_AVX512) # and now for AVX512VBMI +set(CMAKE_REQUIRED_FLAGS "${ICELAKE_FLAG}") CHECK_C_SOURCE_COMPILES("#include <${INTRIN_INC_H}> #if !defined(__AVX512VBMI__) #error no avx512vbmi