ARM64 support for SFML

Added dlls, libs and changed CMake files.
This commit is contained in:
Zombieschannel 2024-06-18 22:06:45 +02:00 committed by Lukas Dürrenberger
parent af4e2d6726
commit 98493bdf51
11 changed files with 20 additions and 11 deletions

View File

@ -422,7 +422,10 @@ if(SFML_OS_WINDOWS)
if(NOT SFML_USE_SYSTEM_DEPS) if(NOT SFML_USE_SYSTEM_DEPS)
# install the binaries of SFML dependencies # install the binaries of SFML dependencies
if(ARCH_32BITS) if(ARCH_ARM64)
install(DIRECTORY extlibs/bin/ARM64/ DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY extlibs/libs-msvc-universal/ARM64/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
elseif(ARCH_X86)
install(DIRECTORY extlibs/bin/x86/ DESTINATION ${CMAKE_INSTALL_BINDIR}) install(DIRECTORY extlibs/bin/x86/ DESTINATION ${CMAKE_INSTALL_BINDIR})
if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14) if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14)
install(DIRECTORY extlibs/libs-msvc/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY extlibs/libs-msvc/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
@ -431,7 +434,7 @@ if(SFML_OS_WINDOWS)
else() else()
install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY extlibs/libs-mingw/x86/ DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif() endif()
elseif(ARCH_64BITS) elseif(ARCH_X64)
install(DIRECTORY extlibs/bin/x64/ DESTINATION ${CMAKE_INSTALL_BINDIR}) install(DIRECTORY extlibs/bin/x64/ DESTINATION ${CMAKE_INSTALL_BINDIR})
if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14) if(SFML_COMPILER_MSVC AND SFML_MSVC_VERSION LESS 14)
install(DIRECTORY extlibs/libs-msvc/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY extlibs/libs-msvc/x64/ DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@ -9,10 +9,14 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
include(CheckTypeSize) include(CheckTypeSize)
check_type_size(void* SIZEOF_VOID_PTR) check_type_size(void* SIZEOF_VOID_PTR)
if(${SIZEOF_VOID_PTR} STREQUAL "4") if(${CMAKE_GENERATOR_PLATFORM} MATCHES "ARM64")
set(ARCH_32BITS 1) set(ARCH_ARM64 1)
elseif("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "" AND ${CMAKE_SYSTEM_PROCESSOR} MATCHES "ARM64")
set(ARCH_ARM64 1)
elseif(${SIZEOF_VOID_PTR} STREQUAL "4")
set(ARCH_X86 1)
elseif(${SIZEOF_VOID_PTR} STREQUAL "8") elseif(${SIZEOF_VOID_PTR} STREQUAL "8")
set(ARCH_64BITS 1) set(ARCH_X64 1)
else() else()
message(FATAL_ERROR "Unsupported architecture") message(FATAL_ERROR "Unsupported architecture")
return() return()

BIN
extlibs/bin/ARM64/openal32.dll vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -6,14 +6,14 @@ include(${PROJECT_SOURCE_DIR}/cmake/Macros.cmake)
if (SFML_OS_WINDOWS) if (SFML_OS_WINDOWS)
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers") set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${PROJECT_SOURCE_DIR}/extlibs/headers")
if(SFML_COMPILER_GCC OR (SFML_COMPILER_CLANG AND MINGW)) if(SFML_COMPILER_GCC OR (SFML_COMPILER_CLANG AND MINGW))
if(ARCH_32BITS) if(ARCH_X86)
if(SFML_RUNTIME_UCRT) if(SFML_RUNTIME_UCRT)
# taking precendence for provided libraries linking UCRT # taking precendence for provided libraries linking UCRT
list(APPEND CMAKE_LIBRARY_PATH "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw-ucrt/x86") list(APPEND CMAKE_LIBRARY_PATH "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw-ucrt/x86")
endif() endif()
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw/x86") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw/x86")
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/bin/x86") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/bin/x86")
elseif(ARCH_64BITS) elseif(ARCH_X64)
if(SFML_RUNTIME_UCRT) if(SFML_RUNTIME_UCRT)
# taking precendence for provided libraries linking UCRT # taking precendence for provided libraries linking UCRT
list(APPEND CMAKE_LIBRARY_PATH "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw-ucrt/x64") list(APPEND CMAKE_LIBRARY_PATH "${PROJECT_SOURCE_DIR}/extlibs/libs-mingw-ucrt/x64")
@ -23,15 +23,17 @@ if (SFML_OS_WINDOWS)
endif() endif()
elseif(SFML_COMPILER_MSVC OR (SFML_COMPILER_CLANG AND NOT MINGW)) elseif(SFML_COMPILER_MSVC OR (SFML_COMPILER_CLANG AND NOT MINGW))
if(SFML_MSVC_VERSION LESS 14) if(SFML_MSVC_VERSION LESS 14)
if(ARCH_32BITS) if(ARCH_X86)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x86") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x86")
elseif(ARCH_64BITS) elseif(ARCH_X64)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x64") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc/x64")
endif() endif()
else() else()
if(ARCH_32BITS) if(ARCH_ARM64)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc-universal/ARM64")
elseif(ARCH_X86)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc-universal/x86") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc-universal/x86")
elseif(ARCH_64BITS) elseif(ARCH_X64)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc-universal/x64") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${PROJECT_SOURCE_DIR}/extlibs/libs-msvc-universal/x64")
endif() endif()
endif() endif()