summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-02 21:47:10 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-03 19:50:12 +0800
commit96d322edfcb97096f701ef11d5fdd1f1c97255ac (patch)
tree20229cbf7c4412d3d7c0a69c6c4b754b2cc060e9 /indra/cmake
parente5c159597f159c308df878d053b591783337a3a1 (diff)
Bring back FMOD, to be used on Fedora only, though
https://megapahit.com/show_bug.cgi?id=64 Dullahan is still not working, something in webrtc-voice is breaking it too. But at least we're halfway now that we don't have to use Fedora's OpenAL that is in conflict with Dullahan/CEF.
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/CMakeLists.txt1
-rw-r--r--indra/cmake/FMODSTUDIO.cmake52
2 files changed, 53 insertions, 0 deletions
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index bed7878118..fa6cd8556b 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -22,6 +22,7 @@ set(cmake_SOURCE_FILES
DragDrop.cmake
EXPAT.cmake
FindAutobuild.cmake
+ FMODSTUDIO.cmake
FreeType.cmake
GLEXT.cmake
GLH.cmake
diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake
new file mode 100644
index 0000000000..38437b7bfb
--- /dev/null
+++ b/indra/cmake/FMODSTUDIO.cmake
@@ -0,0 +1,52 @@
+# -*- cmake -*-
+
+include_guard()
+
+# FMODSTUDIO can be set when launching the make using the argument -DUSE_FMODSTUDIO:BOOL=ON
+# When building using proprietary binaries though (i.e. having access to LL private servers),
+# we always build with FMODSTUDIO.
+if (INSTALL_PROPRIETARY)
+ set(USE_FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.")
+endif (INSTALL_PROPRIETARY)
+
+# ND: To streamline arguments passed, switch from FMODSTUDIO to USE_FMODSTUDIO
+# To not break all old build scripts convert old arguments but warn about it
+if(FMODSTUDIO)
+ message( WARNING "Use of the FMODSTUDIO argument is deprecated, please switch to USE_FMODSTUDIO")
+ set(USE_FMODSTUDIO ${FMODSTUDIO})
+endif()
+
+if (USE_FMODSTUDIO)
+ add_library( ll::fmodstudio INTERFACE IMPORTED )
+ target_compile_definitions( ll::fmodstudio INTERFACE LL_FMODSTUDIO=1)
+
+ if (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
+ # If the path have been specified in the arguments, use that
+
+ target_link_libraries(ll::fmodstudio INTERFACE ${FMODSTUDIO_LIBRARY})
+ target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${FMODSTUDIO_INCLUDE_DIR})
+ else (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
+ # If not, we're going to try to get the package listed in autobuild.xml
+ # Note: if you're not using INSTALL_PROPRIETARY, the package URL should be local (file:/// URL)
+ # as accessing the private LL location will fail if you don't have the credential
+ include(Prebuilt)
+ if (NOT USESYSTEMLIBS)
+ use_prebuilt_binary(fmodstudio)
+ endif ()
+ if (WINDOWS)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod_vc)
+ elseif (DARWIN)
+ #despite files being called libfmod.dylib, we are searching for fmod
+ target_link_libraries( ll::fmodstudio INTERFACE fmod)
+ elseif (LINUX)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod)
+ endif (WINDOWS)
+
+ if (NOT USESYSTEMLIBS)
+ target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio)
+ endif ()
+ endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
+else()
+ set( USE_FMODSTUDIO "OFF")
+endif ()
+