diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-03-30 00:25:16 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2023-03-30 00:25:16 +0300 |
commit | 5217e6bfb77d8f6e0d955415e9d0edea964908e8 (patch) | |
tree | 33b7436bd46a0807bcf21f3b97a3dc9af9849aa7 /indra/cmake/OPENAL.cmake | |
parent | f6ba8306f0210289f12ccbfde3c43eb4dc3feaed (diff) | |
parent | c7053a6928fd5eafdc935453742e92951ae4e0c1 (diff) |
Merge branch 'main' into DRTVWR-577-maint-S
# Conflicts:
# indra/cmake/CMakeLists.txt
# indra/newview/skins/default/xui/es/floater_tools.xml
Diffstat (limited to 'indra/cmake/OPENAL.cmake')
-rw-r--r-- | indra/cmake/OPENAL.cmake | 54 |
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 () |