Skip to content

Commit

Permalink
always check CMAKE_SYSTEM_PROCESSOR with MATCHES
Browse files Browse the repository at this point in the history
This makes it accept values consistently. Before this patch
mingw-w64, Apple and SunOS did not accept a CPU if it had
a suffix or prefix (e.g. a triplet), while other targets did.
  • Loading branch information
vszakats committed Nov 7, 2023
1 parent 27486b1 commit abf3be5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64|ARM64)")
set(HOST_AARCH64 true)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
set(HOST_ARM true)
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
set(HOST_X86_64 true)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64)")
set(HOST_X86_64 true)
Expand Down Expand Up @@ -367,16 +367,16 @@ if(ENABLE_ASM)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" AND
NOT CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(HOST_ASM_ELF_ARMV4 true)
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
elseif(CMAKE_SYSTEM_NAME STREQUAL "SunOS" AND CMAKE_SYSTEM_PROCESSOR MATCHES "i386")
set(HOST_ASM_ELF_X86_64 true)
endif()
add_definitions(-DHAVE_GNU_STACK)
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(HOST_ASM_MACOSX_X86_64 true)
elseif(MSVC AND (CMAKE_GENERATOR MATCHES "Win64" OR CMAKE_GENERATOR_PLATFORM STREQUAL "x64"))
set(HOST_ASM_MASM_X86_64 true)
ENABLE_LANGUAGE(ASM_MASM)
elseif(MINGW AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
elseif(MINGW AND CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
set(HOST_ASM_MINGW64_X86_64 true)
endif()
endif()
Expand Down

0 comments on commit abf3be5

Please sign in to comment.