Skip to content

Commit

Permalink
Land #938, cmake: simplify if expressions, accept CPU values more con…
Browse files Browse the repository at this point in the history
…sistently
  • Loading branch information
busterb committed Nov 8, 2023
2 parents 4322155 + abf3be5 commit b16146e
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -333,50 +333,50 @@ if(APPLE AND (NOT CMAKE_OSX_ARCHITECTURES STREQUAL ""))
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_OSX_ARCHITECTURES}")
endif()

if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(aarch64|arm64|ARM64)")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(aarch64|arm64|ARM64)")
set(HOST_AARCH64 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm")
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)")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64|AMD64)")
set(HOST_X86_64 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(i[3-6]86|[xX]86)")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(i[3-6]86|[xX]86)")
set(ENABLE_ASM false)
set(HOST_I386 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips64")
set(HOST_MIPS64 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "mips")
set(HOST_MIPS true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "powerpc")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "powerpc")
set(HOST_POWERPC true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "ppc64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
set(HOST_PPC64 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "riscv64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
set(HOST_RISCV64 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "sparc64")
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "sparc64")
set(HOST_SPARC64 true)
else()
set(ENABLE_ASM false)
endif()

if(ENABLE_ASM)
if("${CMAKE_C_COMPILER_ABI}" STREQUAL "ELF")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|amd64)")
if(CMAKE_C_COMPILER_ABI STREQUAL "ELF")
if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|amd64)")
set(HOST_ASM_ELF_X86_64 true)
elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" AND
NOT "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm64")
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"))
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 b16146e

Please sign in to comment.