Skip to content

Commit

Permalink
deps: update sndfile to 1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Aug 14, 2023
1 parent 5b1bc06 commit c097734
Show file tree
Hide file tree
Showing 12 changed files with 627 additions and 44 deletions.
67 changes: 67 additions & 0 deletions deps/sndfile/lib/cmake/SndFile/FindFLAC.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# - Find FLAC
# Find the native FLAC includes and libraries
#
# FLAC_INCLUDE_DIRS - where to find FLAC headers.
# FLAC_LIBRARIES - List of libraries when using libFLAC.
# FLAC_FOUND - True if libFLAC found.
# FLAC_DEFINITIONS - FLAC compile definitons

if (FLAC_INCLUDE_DIR)
# Already in cache, be silent
set (FLAC_FIND_QUIETLY TRUE)
endif ()

find_package (Ogg QUIET)

find_package (PkgConfig QUIET)
pkg_check_modules(PC_FLAC QUIET flac)

set(FLAC_VERSION ${PC_FLAC_VERSION})

find_path (FLAC_INCLUDE_DIR FLAC/stream_decoder.h
HINTS
${PC_FLAC_INCLUDEDIR}
${PC_FLAC_INCLUDE_DIRS}
${FLAC_ROOT}
)

# MSVC built libraries can name them *_static, which is good as it
# distinguishes import libraries from static libraries with the same extension.
find_library (FLAC_LIBRARY
NAMES
FLAC
libFLAC
libFLAC_dynamic
libFLAC_static
HINTS
${PC_FLAC_LIBDIR}
${PC_FLAC_LIBRARY_DIRS}
${FLAC_ROOT}
)

# Handle the QUIETLY and REQUIRED arguments and set FLAC_FOUND to TRUE if
# all listed variables are TRUE.
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (FLAC
REQUIRED_VARS
FLAC_LIBRARY
FLAC_INCLUDE_DIR
Ogg_FOUND
VERSION_VAR
FLAC_VERSION
)

if (FLAC_FOUND)
set (FLAC_INCLUDE_DIRS ${FLAC_INCLUDE_DIR})
set (FLAC_LIBRARIES ${FLAC_LIBRARY} ${OGG_LIBRARIES})
if (NOT TARGET FLAC::FLAC)
add_library(FLAC::FLAC UNKNOWN IMPORTED)
set_target_properties(FLAC::FLAC PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_DIR}"
IMPORTED_LOCATION "${FLAC_LIBRARY}"
INTERFACE_LINK_LIBRARIES Ogg::ogg
)
endif ()
endif ()

mark_as_advanced(FLAC_INCLUDE_DIR FLAC_LIBRARY)
61 changes: 61 additions & 0 deletions deps/sndfile/lib/cmake/SndFile/FindOgg.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# - Find ogg
# Find the native ogg includes and libraries
#
# OGG_INCLUDE_DIRS - where to find ogg.h, etc.
# OGG_LIBRARIES - List of libraries when using ogg.
# OGG_FOUND - True if ogg found.

if (OGG_INCLUDE_DIR)
# Already in cache, be silent
set(OGG_FIND_QUIETLY TRUE)
endif ()

find_package (PkgConfig QUIET)
pkg_check_modules (PC_OGG QUIET ogg>=1.3.0)

set (OGG_VERSION ${PC_OGG_VERSION})

find_path (OGG_INCLUDE_DIR ogg/ogg.h
HINTS
${PC_OGG_INCLUDEDIR}
${PC_OGG_INCLUDE_DIRS}
${OGG_ROOT}
)
# MSVC built ogg may be named ogg_static.
# The provided project files name the library with the lib prefix.
find_library (OGG_LIBRARY
NAMES
ogg
ogg_static
libogg
libogg_static
HINTS
${PC_OGG_LIBDIR}
${PC_OGG_LIBRARY_DIRS}
${OGG_ROOT}
)
# Handle the QUIETLY and REQUIRED arguments and set OGG_FOUND
# to TRUE if all listed variables are TRUE.
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (Ogg
REQUIRED_VARS
OGG_LIBRARY
OGG_INCLUDE_DIR
VERSION_VAR
OGG_VERSION
)

if (OGG_FOUND)
set (OGG_LIBRARIES ${OGG_LIBRARY})
set (OGG_INCLUDE_DIRS ${OGG_INCLUDE_DIR})

if(NOT TARGET Ogg::ogg)
add_library(Ogg::ogg UNKNOWN IMPORTED)
set_target_properties(Ogg::ogg PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OGG_INCLUDE_DIRS}"
IMPORTED_LOCATION "${OGG_LIBRARIES}"
)
endif ()
endif ()

mark_as_advanced (OGG_INCLUDE_DIR OGG_LIBRARY)
67 changes: 67 additions & 0 deletions deps/sndfile/lib/cmake/SndFile/FindOpus.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# - Find opus
# Find the native opus includes and libraries
#
# OPUS_INCLUDE_DIRS - where to find opus.h, etc.
# OPUS_LIBRARIES - List of libraries when using opus.
# OPUS_FOUND - True if Opus found.

if (OPUS_INCLUDE_DIR)
# Already in cache, be silent
set(OPUS_FIND_QUIETLY TRUE)
endif ()

find_package (Ogg QUIET)

find_package (PkgConfig QUIET)
pkg_check_modules(PC_OPUS QUIET opus>=1.1)

set (OPUS_VERSION ${PC_OPUS_VERSION})

find_path (OPUS_INCLUDE_DIR opus/opus.h
HINTS
${PC_OPUS_INCLUDEDIR}
${PC_OPUS_INCLUDE_DIRS}
${OPUS_ROOT}
)

# MSVC built opus may be named opus_static.
# The provided project files name the library with the lib prefix.

find_library (OPUS_LIBRARY
NAMES
opus
opus_static
libopus
libopus_static
HINTS
${PC_OPUS_LIBDIR}
${PC_OPUS_LIBRARY_DIRS}
${OPUS_ROOT}
)

# Handle the QUIETLY and REQUIRED arguments and set OPUS_FOUND
# to TRUE if all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args (Opus
REQUIRED_VARS
OPUS_LIBRARY
OPUS_INCLUDE_DIR
OGG_FOUND
VERSION_VAR
OPUS_VERSION
)

if (OPUS_FOUND)
set (OPUS_LIBRARIES ${OPUS_LIBRARY})
set (OPUS_INCLUDE_DIRS ${OPUS_INCLUDE_DIR})

if (NOT TARGET Opus::opus)
add_library (Opus::opus UNKNOWN IMPORTED)
set_target_properties (Opus::opus PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OPUS_INCLUDE_DIRS}"
IMPORTED_LOCATION "${OPUS_LIBRARIES}"
)
endif ()
endif ()

mark_as_advanced(OPUS_INCLUDE_DIR OPUS_LIBRARY)
Loading

0 comments on commit c097734

Please sign in to comment.