aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-09-15 22:22:45 -0700
committerChris Robinson <[email protected]>2017-09-19 10:05:41 -0700
commit51e11fdb9cdc09d52644dce677abc305edbcb9ab (patch)
treeb538ef44a1a5bfb6d43ba9653114276c5d29ea34
parenteaf3b9414384dbb8db73a887d1af9ed094a35dd5 (diff)
Handle libossaudio as an optional OSS library
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/FindOSS.cmake14
2 files changed, 16 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b3bca83a..53770216 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -903,6 +903,9 @@ IF(OSS_FOUND)
SET(HAVE_OSS 1)
SET(BACKENDS "${BACKENDS} OSS,")
SET(ALC_OBJS ${ALC_OBJS} Alc/backends/oss.c)
+ IF(OSS_LIBRARIES)
+ ADD_BACKEND_LIBS(${OSS_LIBRARIES})
+ ENDIF()
ENDIF()
ENDIF()
IF(ALSOFT_REQUIRE_OSS AND NOT HAVE_OSS)
diff --git a/cmake/FindOSS.cmake b/cmake/FindOSS.cmake
index 88ee66ad..feffb451 100644
--- a/cmake/FindOSS.cmake
+++ b/cmake/FindOSS.cmake
@@ -2,8 +2,10 @@
#
# OSS_FOUND - True if OSS_INCLUDE_DIR is found
# OSS_INCLUDE_DIRS - Set when OSS_INCLUDE_DIR is found
+# OSS_LIBRARIES - Set when OSS_LIBRARY is found
#
# OSS_INCLUDE_DIR - where to find sys/soundcard.h, etc.
+# OSS_LIBRARY - where to find libossaudio (optional).
#
find_path(OSS_INCLUDE_DIR
@@ -11,11 +13,21 @@ find_path(OSS_INCLUDE_DIR
DOC "The OSS include directory"
)
+find_library(OSS_LIBRARY
+ NAMES ossaudio
+ DOC "Optional OSS library"
+)
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OSS REQUIRED_VARS OSS_INCLUDE_DIR)
if(OSS_FOUND)
set(OSS_INCLUDE_DIRS ${OSS_INCLUDE_DIR})
+ if(OSS_LIBRARY)
+ set(OSS_LIBRARIES ${OSS_LIBRARY})
+ else()
+ unset(OSS_LIBRARIES)
+ endif()
endif()
-mark_as_advanced(OSS_INCLUDE_DIR)
+mark_as_advanced(OSS_INCLUDE_DIR OSS_LIBRARY)