1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
Description: Fix x86 architecture detection for SIMD enabling
The cmake script uses CMAKE_SYSTEM_PROCESSOR to decide whether SSE2 should be
enabled, but it does not detect the 32 bit x86 architecture properly. That
variable is initialized from uname -m, which on Linux machines has x86_64 for
amd64 architectures which is detected correctly. For 32 bit x86 it will have
something like i386 or i686, but the script tries and fails to match that with
"x86".
.
This patch adds a pattern "i[3-6]86" to catch these.
Author: Andreas Bombe
Last-Update: 2022-11-07
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@ find_package(SoapySDR NO_MODULE REQUIRED
# Compiler specific setup
########################################################################
-IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|x86")
+IF(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64|x86|i[3-6]86")
SET(USE_SIMD "SSE2" CACHE STRING "Use SIMD instructions")
ELSE()
SET(USE_SIMD "no" CACHE STRING "Use SIMD instructions")
|