diff options
author | Chris Robinson <[email protected]> | 2019-07-10 18:54:43 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-07-10 18:54:43 -0700 |
commit | ac28b7d0f2110ea36c559edb627c8e02fa49a38f (patch) | |
tree | b6806da6369e0cad795d466bc1647ddc161cfa9d /CMakeLists.txt | |
parent | 426c4587ccc78ee9a3d36c7120596fbb037b3ff8 (diff) |
Use a find module for OpenSL
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3614ec29..01baa040 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1080,17 +1080,15 @@ ENDIF() # Check for OpenSL (Android) backend OPTION(ALSOFT_REQUIRE_OPENSL "Require OpenSL backend" OFF) -CHECK_INCLUDE_FILES("SLES/OpenSLES.h;SLES/OpenSLES_Android.h" HAVE_SLES_OPENSLES_ANDROID_H) -IF(HAVE_SLES_OPENSLES_ANDROID_H) - CHECK_SHARED_FUNCTION_EXISTS(slCreateEngine "SLES/OpenSLES.h" OpenSLES "" HAVE_LIBOPENSLES) - IF(HAVE_LIBOPENSLES) - OPTION(ALSOFT_BACKEND_OPENSL "Enable OpenSL backend" ON) - IF(ALSOFT_BACKEND_OPENSL) - SET(HAVE_OPENSL 1) - SET(ALC_OBJS ${ALC_OBJS} Alc/backends/opensl.cpp Alc/backends/opensl.h) - SET(BACKENDS "${BACKENDS} OpenSL,") - SET(EXTRA_LIBS OpenSLES ${EXTRA_LIBS}) - ENDIF() +FIND_PACKAGE(OpenSL) +IF(OPENSL_FOUND) + OPTION(ALSOFT_BACKEND_OPENSL "Enable OpenSL backend" ON) + IF(ALSOFT_BACKEND_OPENSL) + SET(HAVE_OPENSL 1) + SET(ALC_OBJS ${ALC_OBJS} Alc/backends/opensl.cpp Alc/backends/opensl.h) + SET(BACKENDS "${BACKENDS} OpenSL,") + SET(EXTRA_LIBS ${OPENSL_LIBRARIES} ${EXTRA_LIBS}) + SET(INC_PATHS ${INC_PATHS} ${OPENSL_INCLUDE_DIRS}) ENDIF() ENDIF() IF(ALSOFT_REQUIRE_OPENSL AND NOT HAVE_OPENSL) |