Fix Switch OpenAL (#4560)

This commit is contained in:
Mary 2021-07-20 12:39:36 -04:00 committed by GitHub
parent 8a7413b3e7
commit feb0118b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,7 +48,7 @@ CMAKE_DEPENDENT_OPTION(USE_SYSTEM_SQUISH "Use system Squish library instead of t
CMAKE_DEPENDENT_OPTION(USE_WIIUSE "Support for wiimote input devices" ON
"NOT SERVER_ONLY;NOT CYGWIN;NOT USE_SWITCH;NOT MSVC" OFF)
CMAKE_DEPENDENT_OPTION(USE_DNS_C "Build bundled dns resolver" OFF "NOT CYGWIN;NOT USE_SWITCH" ON)
CMAKE_DEPENDENT_OPTION(USE_MOJOAL "Use bundled MojoAL instead of system OpenAL" OFF "NOT APPLE;NOT USE_SWITCH" ON)
CMAKE_DEPENDENT_OPTION(USE_MOJOAL "Use bundled MojoAL instead of system OpenAL" OFF "NOT APPLE" ON)
if (DLOPEN_MOLTENVK)
ADD_DEFINITIONS(-DDLOPEN_MOLTENVK)
@ -389,6 +389,13 @@ if(NOT SERVER_ONLY)
include_directories(BEFORE "${PROJECT_SOURCE_DIR}/lib/mojoal")
else()
find_package(OpenAL REQUIRED)
# Unclear why this happens, but on switch OPENAL_LIBRARY never set!
if (NOT OPENAL_LIBRARY)
find_library(OPENAL_LIBRARY NAMES al OpenAL AL openal REQUIRED)
endif()
if (NOT OPENAL_INCLUDE_DIR)
find_path(OPENAL_INCLUDE_DIR NAMES AL/al.h REQUIRED)
endif()
include_directories(${OPENAL_INCLUDE_DIR})
endif()