Browse Source

CMake: Don't try to build FMOD Ex audio module for arm64

rdb 5 years ago
parent
commit
113dd6a357
1 changed files with 12 additions and 1 deletions
  1. 12 1
      panda/src/audiotraits/CMakeLists.txt

+ 12 - 1
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}