Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
games
devilutionx
aarch64-fix-detection.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File aarch64-fix-detection.patch of Package devilutionx
From 2bee330b1506e7964b45762e47e5fdcf4ceb5952 Mon Sep 17 00:00:00 2001 From: Alexander Arlt <alexander.arlt@arlt-labs.com> Date: Fri, 25 Mar 2022 18:33:56 -0500 Subject: [PATCH] cmake: add arch detection. --- CMakeLists.txt | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index be00ded3..1aa2098e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,53 @@ if(BUILD_WIN32 set(BUILD_WIN TRUE) endif() +SET(ZT_ARCHITECTURE 999) +IF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "amd64") + SET(ZT_ARCHITECTURE 2) + SET(ZT_USE_X64_ASM_SALSA 1) + SET(ZT_USE_X64_ASM_ED25519 1) + SET(ZT_SSO_SUPPORTED 1) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse -msse2") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse -msse2") +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc64le") + SET(ZT_ARCHITECTURE 8) + ADD_DEFINITIONS(-DZT_NO_TYPE_PUNNING) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "powerpc") + SET(ZT_ARCHITECTURE 8) + ADD_DEFINITIONS(-DZT_NO_TYPE_PUNNING -DZT_NO_CAPABILITIES) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc64el") + SET(ZT_ARCHITECTURE 8) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "e2k") + SET(ZT_ARCHITECTURE 2) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "i386" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i486" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i586" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i686") + SET(ZT_ARCHITECTURE 1) + SET(ZT_SSO_SUPPORTED 1) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armel" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armhf" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv6" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv6l" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv6zk" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7hl" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7ve") + SET(ZT_ARCHITECTURE 3) + SET(ZT_USE_ARM32_NEON_ASM_CRYPTO 1) + ADD_DEFINITIONS(-DZT_NO_TYPE_PUNNING) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") + SET(ZT_ARCHITECTURE 4) + SET(ZT_SSO_SUPPORTED 1) + ADD_DEFINITIONS(-DZT_NO_TYPE_PUNNING -DZT_ARCH_ARM_HAS_NEON -march=armv8-a+crypto -mtune=generic -mstrict-align) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mipsel" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips") + SET(ZT_ARCHITECTURE 5) + ADD_DEFINITIONS(-DZT_NO_TYPE_PUNNING) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips64" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "mips64el") + SET(ZT_ARCHITECTURE 6) + ADD_DEFINITIONS(-DZT_NO_TYPE_PUNNING) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "s390x") + SET(ZT_ARCHITECTURE 16) +ELSEIF (${CMAKE_SYSTEM_PROCESSOR} MATCHES "riscv64") + SET(ZT_ARCHITECTURE 0) +ENDIF () + +IF (${ZT_ARCHITECTURE} EQUAL 999) + message(FATAL_ERROR "FATAL: architecture could not be determined by CMake: ${CMAKE_SYSTEM_PROCESSOR}") +else() + message(STATUS "Detected architecture: ${CMAKE_SYSTEM_PROCESSOR}") +ENDIF() + # Linux # if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor