From 113dd6a3573206a1de3a4ff0fedaa7e28df99fe0 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 18 Dec 2020 23:48:07 +0100 Subject: [PATCH] CMake: Don't try to build FMOD Ex audio module for arm64 --- panda/src/audiotraits/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 27b70e1bb6..c90b9dcbae 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -5,7 +5,7 @@ elseif(NOT HAVE_FMODEX AND NOT HAVE_OPENAL) "You must have an audio backend for audio support! Turn off HAVE_AUDIO to ignore this.") endif() -if(HAVE_FMODEX) +if(HAVE_FMODEX AND NOT (APPLE AND CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")) set(P3FMOD_HEADERS config_fmodAudio.h fmodAudioManager.h @@ -21,6 +21,17 @@ if(HAVE_FMODEX) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) target_link_libraries(p3fmod_audio panda PKG::FMODEX) + if(APPLE) + # The FMOD EX thirdparty library is not available for arm64, so we have to + # exclude it from the target architectures. + get_target_property(_archs p3fmod_audio OSX_ARCHITECTURES) + + if(_archs AND _archs MATCHES "arm64") + list(REMOVE_ITEM _archs "arm64") + set_target_properties(p3fmod_audio PROPERTIES OSX_ARCHITECTURES "${_archs}") + endif() + endif() + install(TARGETS p3fmod_audio EXPORT FMOD COMPONENT FMOD DESTINATION ${CMAKE_INSTALL_LIBDIR}