Browse Source

cmake: add amd64 arch fallback

drTr0jan 7 months ago
parent
commit
78ac89b178
2 changed files with 4 additions and 2 deletions
  1. 1 1
      cmake/compiler-specific.cmake
  2. 3 1
      cmake/defs.cmake

+ 1 - 1
cmake/compiler-specific.cmake

@@ -8,7 +8,7 @@ option(PROFILE "Enable profiling" OFF)
 add_library(common_compiler_flags INTERFACE)
 
 # Define the flags for the C compiler
-if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
 
   if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
     target_compile_definitions(common_compiler_flags INTERFACE CC_GCC_LIKE_ASM)

+ 3 - 1
cmake/defs.cmake

@@ -14,6 +14,8 @@ message(STATUS "OS version: ${OSREL}")
 
 if(CMAKE_SYSTEM_PROCESSOR MATCHES "i386|i486|i586|i686")
   set(TARGET_ARCH "i386")
+elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|amd64")
+  set(TARGET_ARCH "x86_64")
 else()
   set(TARGET_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
 endif()
@@ -139,7 +141,7 @@ option(USE_FAST_LOCK "Use fast locking if available" ON)
 # Check the system processor type and set USE_FAST_LOCK accordingly
 if(USE_FAST_LOCK)
   if(CMAKE_SYSTEM_PROCESSOR MATCHES
-     "i386|i486|i586|i686|x86_64|sparc64|sparc|ppc|ppc64|alpha|mips2|mips64")
+     "i386|i486|i586|i686|x86_64|amd64|sparc64|sparc|ppc|ppc64|alpha|mips2|mips64")
     set(USE_FAST_LOCK YES)
   elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
     set(USE_FAST_LOCK NO)