summaryrefslogtreecommitdiff
path: root/indra/cmake/FMODSTUDIO.cmake
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2023-04-03 14:58:58 -0700
committerCallum Prentice <callum@lindenlab.com>2023-04-03 14:58:58 -0700
commit28b240fd7fc39ff4668e37b5aa3bdfe392415b34 (patch)
tree923892b5ea9e9ac4d757fba089f0e9b2b24fbf26 /indra/cmake/FMODSTUDIO.cmake
parent7b9866791ac7922f7527811bbc99c090f35e4cfd (diff)
parentc7053a6928fd5eafdc935453742e92951ae4e0c1 (diff)
DRTVWR-489: Fix things up after a messy merge with main because of a gigantic CMake patch. Sadly, my macOS box updated to Xcode14.3 overnight and that caused many warnings/errors with variables being initialized and then used but not in a way that affected anything.. Building on Xcode 14.3 also requires that MACOSX_DEPLOYMENT_TARGET be set to > 10.13. Waiting on a decision about that but checking this in in the meantime. Builds on macOS with appropriate build variables set for MACOSX_DEPLOYMENT_TARGET = 10.14 but not really expecting this to build in TC because (REDACTED). Windows version probably hopelessly broken - switching to that now.
Diffstat (limited to 'indra/cmake/FMODSTUDIO.cmake')
-rw-r--r--indra/cmake/FMODSTUDIO.cmake40
1 files changed, 25 insertions, 15 deletions
diff --git a/indra/cmake/FMODSTUDIO.cmake b/indra/cmake/FMODSTUDIO.cmake
index 8840354ac6..c5b21ac4e5 100644
--- a/indra/cmake/FMODSTUDIO.cmake
+++ b/indra/cmake/FMODSTUDIO.cmake
@@ -1,16 +1,30 @@
# -*- cmake -*-
+include_guard()
+
# FMODSTUDIO can be set when launching the make using the argument -DFMODSTUDIO: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(FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.")
+ set(USE_FMODSTUDIO ON CACHE BOOL "Using FMODSTUDIO sound library.")
endif (INSTALL_PROPRIETARY)
-if (FMODSTUDIO)
+# 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
- set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY})
+
+ 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)
@@ -18,21 +32,17 @@ if (FMODSTUDIO)
include(Prebuilt)
use_prebuilt_binary(fmodstudio)
if (WINDOWS)
- set(FMODSTUDIO_LIBRARY
- debug fmodL_vc
- optimized fmod_vc)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod_vc)
elseif (DARWIN)
#despite files being called libfmod.dylib, we are searching for fmod
- set(FMODSTUDIO_LIBRARY
- debug fmodL
- optimized fmod)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod)
elseif (LINUX)
- set(FMODSTUDIO_LIBRARY
- debug fmodL
- optimized fmod)
+ target_link_libraries( ll::fmodstudio INTERFACE fmod)
endif (WINDOWS)
- set(FMODSTUDIO_LIBRARIES ${FMODSTUDIO_LIBRARY})
- set(FMODSTUDIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/fmodstudio)
+
+ target_include_directories( ll::fmodstudio SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/fmodstudio)
endif (FMODSTUDIO_LIBRARY AND FMODSTUDIO_INCLUDE_DIR)
-endif (FMODSTUDIO)
+else()
+ set( USE_FMODSTUDIO "OFF")
+endif ()