From 2aed6241ebd157fce550cea42df10a8af1a1b34a Mon Sep 17 00:00:00 2001 From: Alex von Gluck IV Date: Wed, 22 Mar 2023 14:43:58 -0500 Subject: [PATCH] CMakeLists: Fix Haiku CPU detection (#39) --- src/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 466e2117d..73658a5fa 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -93,20 +93,20 @@ elseif (UNAME_S MATCHES "Linux") message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}") elseif (UNAME_S MATCHES "Haiku") message(STATUS "Haiku detected") - execute_process(COMMAND sysinfo -cpu | grep "AVX " OUTPUT_VARIABLE AVX1_M) - if (AVX1_M MATCHES "avx") + execute_process(COMMAND bash -c "sysinfo -cpu | grep -w AVX" OUTPUT_VARIABLE AVX1_M) + if (AVX1_M MATCHES "AVX") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx") endif() - execute_process(COMMAND sysinfo -cpu | grep "AVX2 " OUTPUT_VARIABLE AVX2_M) - if (AVX2_M MATCHES "avx2") + execute_process(COMMAND bash -c "sysinfo -cpu | grep -w AVX2" OUTPUT_VARIABLE AVX2_M) + if (AVX2_M MATCHES "AVX2") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2") endif() - execute_process(COMMAND sysinfo -cpu | grep "FMA " OUTPUT_VARIABLE FMA_M) - if (FMA_M MATCHES "fma") + execute_process(COMMAND bash -c "sysinfo -cpu | grep -w FMA" OUTPUT_VARIABLE FMA_M) + if (FMA_M MATCHES "FMA") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfma") endif() - execute_process(COMMAND sysinfo -cpu | grep "F16C " OUTPUT_VARIABLE F16C_M) - if (F16C_M MATCHES "f16c") + execute_process(COMMAND bash -c "sysinfo -cpu | grep -w F16C" OUTPUT_VARIABLE F16C_M) + if (F16C_M MATCHES "F16C") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mf16c") endif() message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")