From bf4793a8671e0c887e377b8076324c5d0ee99f88 Mon Sep 17 00:00:00 2001 From: PBeGood4 Date: Thu, 3 Mar 2022 19:16:03 +0000 Subject: [PATCH] Allow multiple archs --- prboom2/CMakeLists.txt | 12 +++++++----- prboom2/cmake/TargetArch.cmake | 6 ++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/prboom2/CMakeLists.txt b/prboom2/CMakeLists.txt index 25bc840bd..90a7b3051 100644 --- a/prboom2/CMakeLists.txt +++ b/prboom2/CMakeLists.txt @@ -24,11 +24,13 @@ include(GNUInstallDirs) # Automated dependencies discovery, mostly needed for MSVC target_architecture(TARGET_ARCH) -if(${TARGET_ARCH} MATCHES "i386") - set(DEPENDENCY_SUFFIX x86) -elseif(${TARGET_ARCH} MATCHES "x86_64") - set(DEPENDENCY_SUFFIX x64) -endif() +foreach(target ${TARGET_ARCH}) + if(${target} MATCHES "i386") + set(DEPENDENCY_SUFFIX x86) + elseif(${target} MATCHES "x86_64") + set(DEPENDENCY_SUFFIX x64) + endif() +endforeach() set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../dependencies_${DEPENDENCY_SUFFIX}") set(PACKAGE_NAME "${PROJECT_NAME}") diff --git a/prboom2/cmake/TargetArch.cmake b/prboom2/cmake/TargetArch.cmake index 198aa9c05..2cfef741b 100644 --- a/prboom2/cmake/TargetArch.cmake +++ b/prboom2/cmake/TargetArch.cmake @@ -96,6 +96,8 @@ function(target_architecture output_var) set(osx_arch_x86_64 TRUE) elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support) set(osx_arch_ppc64 TRUE) + elseif("${osx_arch}" STREQUAL "arm64") + set(osx_arch_arm64 TRUE) else() message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}") endif() @@ -117,6 +119,10 @@ function(target_architecture output_var) if(osx_arch_ppc64) list(APPEND ARCH ppc64) endif() + + if(osx_arch_arm64) + list(APPEND ARCH arm64) + endif() else() file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")