From 951b413ad1297f46a35f52a53b869826eb11d2eb Mon Sep 17 00:00:00 2001 From: "G.E." Date: Thu, 4 Jul 2024 17:41:44 +0300 Subject: [PATCH] building non-fat as well --- CMakeLists.txt | 4 ++++ cmake/cflags-x86.cmake | 4 ---- cmake/simde.cmake | 7 +++++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2218e35e..54e22904 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,10 @@ include (${CMAKE_MODULE_PATH}/platform.cmake) # Detect OS and if Fat Runtime is available include (${CMAKE_MODULE_PATH}/osdetection.cmake) +if(BUILD_SSE2_SIMDE) + set(SIMDE_BACKEND True) +endif() + if(SIMDE_BACKEND) include (${CMAKE_MODULE_PATH}/simde.cmake) elseif (ARCH_IA32 OR ARCH_X86_64) diff --git a/cmake/cflags-x86.cmake b/cmake/cflags-x86.cmake index 020064fe..4e2b8a7d 100644 --- a/cmake/cflags-x86.cmake +++ b/cmake/cflags-x86.cmake @@ -25,10 +25,6 @@ if (NOT FAT_RUNTIME) set(ARCH_C_FLAGS "-mavx2") set(ARCH_CXX_FLAGS "-mavx2") set(X86_ARCH "core-avx2") - elseif (BUILD_SSE2_SIMDE) - set(ARCH_C_FLAGS "-msse2") - set(ARCH_CXX_FLAGS "-msse2") - set(X86_ARCH "x86-64") else() set(ARCH_C_FLAGS "-msse4.2") set(ARCH_CXX_FLAGS "-msse4.2") diff --git a/cmake/simde.cmake b/cmake/simde.cmake index 9240fdc2..9cfaaf4b 100644 --- a/cmake/simde.cmake +++ b/cmake/simde.cmake @@ -24,6 +24,13 @@ if (SIMDE_SSE42_H_FOUND) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVS_SIMDE_NATIVE -DSIMDE_ENABLE_OPENMP -fopenmp-simd") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVS_SIMDE_NATIVE -DSIMDE_ENABLE_OPENMP -fopenmp-simd") endif() + + if (BUILD_SSE2_SIMDE) + set(ARCH_C_FLAGS "-msse2") + set(ARCH_CXX_FLAGS "-msse2") + set(X86_ARCH "x86-64") + endif() + else() message(FATAL_ERROR "SIMDe backend requested but SIMDe is not available on the system") endif()