summaryrefslogtreecommitdiff
path: root/indra/cmake/OPENAL.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/OPENAL.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/OPENAL.cmake')
-rw-r--r--indra/cmake/OPENAL.cmake54
1 files changed, 30 insertions, 24 deletions
diff --git a/indra/cmake/OPENAL.cmake b/indra/cmake/OPENAL.cmake
index 1bbfff6f98..0b6a7c2853 100644
--- a/indra/cmake/OPENAL.cmake
+++ b/indra/cmake/OPENAL.cmake
@@ -2,31 +2,37 @@
include(Linking)
include(Prebuilt)
-if (LINUX)
- set(OPENAL ON CACHE BOOL "Enable OpenAL")
-else (LINUX)
- set(OPENAL OFF CACHE BOOL "Enable OpenAL")
-endif (LINUX)
+include_guard()
+
+# ND: Turn this off by default, the openal code in the viewer isn't very well maintained, seems
+# to have memory leaks, has no option to play music streams
+# It probably makes sense to to completely remove it
+
+set(USE_OPENAL OFF CACHE BOOL "Enable OpenAL")
+# ND: To streamline arguments passed, switch from OPENAL to USE_OPENAL
+# To not break all old build scripts convert old arguments but warn about it
+if(OPENAL)
+ message( WARNING "Use of the OPENAL argument is deprecated, please switch to USE_OPENAL")
+ set(USE_OPENAL ${OPENAL})
+endif()
+
+if (USE_OPENAL)
+ add_library( ll::openal INTERFACE IMPORTED )
+ target_include_directories( ll::openal SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/AL")
+ target_compile_definitions( ll::openal INTERFACE LL_OPENAL=1)
+ use_prebuilt_binary(openal)
-if (OPENAL)
- set(OPENAL_LIB_INCLUDE_DIRS "${LIBS_PREBUILT_DIR}/include/AL")
- if (USESYSTEMLIBS)
- include(FindPkgConfig)
- include(FindOpenAL)
- pkg_check_modules(OPENAL_LIB REQUIRED openal)
- pkg_check_modules(FREEALUT_LIB REQUIRED freealut)
- else (USESYSTEMLIBS)
- use_prebuilt_binary(openal)
- endif (USESYSTEMLIBS)
if(WINDOWS)
- set(OPENAL_LIBRARIES
- OpenAL32
- alut
- )
+ target_link_libraries( ll::openal INTERFACE
+ OpenAL32
+ alut
+ )
+ elseif(LINUX)
+ target_link_libraries( ll::openal INTERFACE
+ openal
+ alut
+ )
else()
- set(OPENAL_LIBRARIES
- openal
- alut
- )
+ message(FATAL_ERROR "OpenAL is not available for this platform")
endif()
-endif (OPENAL)
+endif ()