Merge pull request #1037 from devnexen/cmake_arch_fix

fix cmake assumption on x86 arch.
This commit is contained in:
Yamagi 2023-08-13 09:52:32 +02:00 committed by GitHub
commit 9316bd0ba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,10 +133,10 @@ if(cpu STREQUAL "powerpc")
elseif(cpu STREQUAL "aarch64") elseif(cpu STREQUAL "aarch64")
# "arm64" is more obvious, and some operating systems (like macOS) use it instead of "aarch64" # "arm64" is more obvious, and some operating systems (like macOS) use it instead of "aarch64"
set(cpu "arm64") set(cpu "arm64")
elseif(cpu MATCHES "[aA][mM][dD]64" OR cpu MATCHES "[xX].*64")
set(cpu "x86_64")
elseif(cpu MATCHES "i.86" OR cpu MATCHES "[xX]86") elseif(cpu MATCHES "i.86" OR cpu MATCHES "[xX]86")
set(cpu "i386") set(cpu "i386")
elseif(cpu MATCHES "[aA][mM][dD]64" OR cpu MATCHES "[xX]64")
set(cpu "x86_64")
elseif(cpu MATCHES "[aA][rR][mM].*") # some kind of arm.. elseif(cpu MATCHES "[aA][rR][mM].*") # some kind of arm..
# On 32bit Raspbian gcc -dumpmachine returns sth starting with "arm-", # On 32bit Raspbian gcc -dumpmachine returns sth starting with "arm-",
# while clang -dumpmachine says "arm6k-..." - try to unify that to "arm" # while clang -dumpmachine says "arm6k-..." - try to unify that to "arm"