Skip to content

Commit 25ed0fa

Browse files
committed
Merge remote-tracking branch 'origin/master' into dsp-cpp
2 parents 68074d6 + 694f72f commit 25ed0fa

22 files changed

+827
-265
lines changed

CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# FluidSynth - A Software Synthesizer
22
#
3-
# Copyright (C) 2003-2023 Peter Hanappe and others.
3+
# Copyright (C) 2003-2024 Peter Hanappe and others.
44
#
55
# This library is free software; you can redistribute it and/or
66
# modify it under the terms of the GNU Lesser General Public License
@@ -47,7 +47,7 @@ set ( PACKAGE "fluidsynth" )
4747
# FluidSynth package version
4848
set ( FLUIDSYNTH_VERSION_MAJOR 2 )
4949
set ( FLUIDSYNTH_VERSION_MINOR 4 )
50-
set ( FLUIDSYNTH_VERSION_MICRO 1 )
50+
set ( FLUIDSYNTH_VERSION_MICRO 2 )
5151
set ( VERSION "${FLUIDSYNTH_VERSION_MAJOR}.${FLUIDSYNTH_VERSION_MINOR}.${FLUIDSYNTH_VERSION_MICRO}" )
5252
set ( FLUIDSYNTH_VERSION ${VERSION} )
5353

@@ -62,7 +62,7 @@ set ( FLUIDSYNTH_VERSION ${VERSION} )
6262
# This is not exactly the same algorithm as the libtool one, but the results are the same.
6363
set ( LIB_VERSION_CURRENT 3 )
6464
set ( LIB_VERSION_AGE 3 )
65-
set ( LIB_VERSION_REVISION 1 )
65+
set ( LIB_VERSION_REVISION 2 )
6666
set ( LIB_VERSION_INFO
6767
"${LIB_VERSION_CURRENT}.${LIB_VERSION_AGE}.${LIB_VERSION_REVISION}" )
6868

@@ -521,7 +521,7 @@ set ( ALSA_MINIMUM_VERSION 0.9.1 )
521521
set ( DBUS_MINIMUM_VERSION 1.11.12 )
522522
set ( GLIB2_MINUMUM_VERSION 2.6.5 )
523523
set ( LIBINSTPATCH_MINIMUM_VERSION 1.1.0 )
524-
set ( LIBSNDFILE_MINIMUM_VERSION 1.2.1 )
524+
set ( LIBSNDFILE_MINIMUM_VERSION 1.0.0 )
525525
set ( PIPEWIRE_MINIMUM_VERSION 0.3 )
526526
set ( PORTAUDIO_MINIMUM_VERSION 2.19 )
527527
set ( PULSEAUDIO_MINIMUM_VERSION 2.0 )
@@ -547,6 +547,11 @@ unset ( LIBSNDFILE_HASVORBIS CACHE )
547547
if ( enable-libsndfile )
548548
#set(CMAKE_FIND_DEBUG_MODE ON)
549549
find_package ( SndFile ${LIBSNDFILE_MINIMUM_VERSION} QUIET )
550+
if ( NOT SndFile_FOUND )
551+
# Not all distros have switched to libsndfile's cmake based build system, see #1445.
552+
# Therefore, discover sndfile via the legacy pkg-config magic.
553+
find_package ( SndFileLegacy )
554+
endif ()
550555
set ( LIBSNDFILE_SUPPORT ${SndFile_FOUND} )
551556
if ( LIBSNDFILE_SUPPORT )
552557
message ( STATUS "Found libSndFile: ${SndFile_VERSION}" )

FluidSynthConfig.cmake.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ set(FLUIDSYNTH_SUPPORT_WINMIDI @WINMIDI_SUPPORT@)
2222
set(FLUIDSYNTH_SUPPORT_DLS @LIBINSTPATCH_SUPPORT@)
2323
set(FLUIDSYNTH_SUPPORT_LIBINSTPATCH @LIBINSTPATCH_SUPPORT@)
2424
set(FLUIDSYNTH_SUPPORT_LIBSNDFILE @LIBSNDFILE_SUPPORT@)
25+
set(FLUIDSYNTH_SUPPORT_LIBSNDFILE_LEGACY @SndFileLegacy_FOUND@)
2526
set(FLUIDSYNTH_SUPPORT_SF3 @LIBSNDFILE_HASVORBIS@)
2627

2728
# Miscrellaneous support
@@ -96,7 +97,9 @@ if(NOT FLUIDSYNTH_IS_SHARED)
9697
find_dependency(InstPatch @LIBINSTPATCH_MINIMUM_VERSION@)
9798
endif()
9899

99-
if(FLUIDSYNTH_SUPPORT_LIBSNDFILE AND NOT TARGET SndFile::sndfile)
100+
if(FLUIDSYNTH_SUPPORT_LIBSNDFILE_LEGACY AND NOT TARGET SndFile::sndfile)
101+
find_dependency(SndFileLegacy @LIBSNDFILE_MINIMUM_VERSION@)
102+
elseif(FLUIDSYNTH_SUPPORT_LIBSNDFILE AND NOT TARGET SndFile::sndfile)
100103
find_dependency(SndFile @LIBSNDFILE_MINIMUM_VERSION@)
101104
endif()
102105

cmake_admin/FindFLAC.cmake

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
#[=======================================================================[.rst:
2+
FindFLAC
3+
-------
4+
5+
Finds the FLAC library.
6+
7+
Imported Targets
8+
^^^^^^^^^^^^^^^^
9+
10+
This module provides the following imported targets, if found:
11+
12+
``FLAC::FLAC``
13+
The FLAC C library.
14+
``FLAC::FLAC++``
15+
The FLAC C++ library.
16+
17+
Result Variables
18+
^^^^^^^^^^^^^^^^
19+
20+
This will define the following variables:
21+
22+
``FLAC_FOUND``
23+
True if both libraries were found.
24+
``FLAC_FLAC_FOUND``
25+
True if the C library was found.
26+
``FLAC_FLAC++_FOUND``
27+
True if the C++ library was found..
28+
29+
#]=======================================================================]
30+
31+
# Use pkg-config if available
32+
find_package(PkgConfig QUIET)
33+
pkg_check_modules(PC_FLAC QUIET flac)
34+
pkg_check_modules(PC_FLAC++ QUIET flac++)
35+
36+
# Find the headers and libraries
37+
find_path(
38+
FLAC_INCLUDE_DIR
39+
NAMES "FLAC/all.h"
40+
HINTS "PC_FLAC_INCLUDEDIR")
41+
42+
find_path(
43+
FLAC++_INCLUDE_DIR
44+
NAMES "FLAC++/all.h"
45+
HINTS "PC_FLAC++_INCLUDEDIR")
46+
47+
find_library(
48+
FLAC_LIBRARY
49+
NAMES "FLAC"
50+
HINTS "${PC_FLAC_LIBDIR}")
51+
52+
find_library(
53+
FLAC++_LIBRARY
54+
NAMES "FLAC++"
55+
HINTS "${PC_FLAC++_LIBDIR}")
56+
57+
# Handle transitive dependencies
58+
if(PC_FLAC_FOUND)
59+
get_target_properties_from_pkg_config("${FLAC_LIBRARY}" "PC_FLAC" "_flac")
60+
else()
61+
if(NOT TARGET "Ogg::ogg")
62+
find_package(Ogg QUIET)
63+
endif()
64+
set(_flac_link_libraries "Ogg::ogg" ${MATH_LIBRARY})
65+
endif()
66+
67+
if(PC_FLAC++_FOUND)
68+
get_target_properties_from_pkg_config("${FLAC++_LIBRARY}" "PC_FLAC++"
69+
"_flac++")
70+
else()
71+
set(_flac++_link_libraries "FLAC::FLAC")
72+
endif()
73+
74+
# Forward the result to CMake
75+
include(FindPackageHandleStandardArgs)
76+
find_package_handle_standard_args(
77+
FLAC REQUIRED_VARS "FLAC_LIBRARY" "FLAC_INCLUDE_DIR" "FLAC++_LIBRARY"
78+
"FLAC++_INCLUDE_DIR")
79+
80+
# Create the target
81+
if(FLAC_FOUND AND NOT TARGET FLAC::FLAC)
82+
add_library(FLAC::FLAC UNKNOWN IMPORTED)
83+
set_target_properties(
84+
FLAC::FLAC
85+
PROPERTIES IMPORTED_LOCATION "${FLAC_LIBRARY}"
86+
INTERFACE_COMPILE_OPTIONS "${_flac_compile_options}"
87+
INTERFACE_INCLUDE_DIRECTORIES "${FLAC_INCLUDE_DIR}"
88+
INTERFACE_LINK_LIBRARIES "${_flac_link_libraries}"
89+
INTERFACE_LINK_DIRECTORIES "${_flac_link_directories}")
90+
set(FLAC_FLAC_FOUND TRUE)
91+
endif()
92+
93+
if(FLAC_FOUND AND NOT TARGET FLAC::FLAC++)
94+
add_library(FLAC::FLAC++ UNKNOWN IMPORTED)
95+
set_target_properties(
96+
FLAC::FLAC++
97+
PROPERTIES IMPORTED_LOCATION "${FLAC++_LIBRARY}"
98+
INTERFACE_COMPILE_OPTIONS "${_flac++_compile_options}"
99+
INTERFACE_INCLUDE_DIRECTORIES "${FLAC++_INCLUDE_DIR}"
100+
INTERFACE_LINK_LIBRARIES "${_flac++_link_libraries}"
101+
INTERFACE_LINK_DIRECTORIES "${_flac++_link_directories}")
102+
set(FLAC_FLAC++_FOUND TRUE)
103+
endif()
104+
105+
mark_as_advanced(FLAC_LIBRARY FLAC_INCLUDE_DIR FLAC++_LIBRARY
106+
FLAC++_INCLUDE_DIR)

cmake_admin/FindOgg.cmake

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#[=======================================================================[.rst:
2+
FindOgg
3+
-------
4+
5+
Finds the Ogg library.
6+
7+
Imported Targets
8+
^^^^^^^^^^^^^^^^
9+
10+
This module provides the following imported targets, if found:
11+
12+
``Ogg::ogg``
13+
The Ogg library
14+
15+
Result Variables
16+
^^^^^^^^^^^^^^^^
17+
18+
This will define the following variables:
19+
20+
``Ogg_FOUND``
21+
True if the system has the Ogg library.
22+
23+
For compatibility with upstream, the following variables are also set:
24+
25+
``Ogg_INCLUDE_DIR``
26+
``Ogg_INCLUDE_DIRS``
27+
``Ogg_LIBRARY``
28+
``Ogg_LIBRARIES``
29+
``OGG_INCLUDE_DIR``
30+
``OGG_INCLUDE_DIRS``
31+
``OGG_LIBRARY``
32+
``OGG_LIBRARIES``
33+
``OGG_FOUND``
34+
35+
#]=======================================================================]
36+
37+
# Use pkg-config if available
38+
find_package(PkgConfig QUIET)
39+
pkg_check_modules(PC_OGG QUIET ogg)
40+
41+
# Find the headers and library
42+
find_path(
43+
Ogg_INCLUDE_DIR
44+
NAMES "ogg/ogg.h"
45+
HINTS "${PC_OGG_INCLUDEDIR}")
46+
47+
find_library(
48+
_ogg_library
49+
NAMES "ogg"
50+
HINTS "${PC_OGG_LIBDIR}")
51+
52+
# Extract additional flags if pkg-config is available
53+
if(PC_OGG_FOUND)
54+
get_target_properties_from_pkg_config("${_ogg_library}" "PC_OGG" "_ogg")
55+
endif()
56+
57+
# Forward the result to CMake
58+
include(FindPackageHandleStandardArgs)
59+
find_package_handle_standard_args(Ogg REQUIRED_VARS "_ogg_library"
60+
"Ogg_INCLUDE_DIR")
61+
62+
# Create the target
63+
if(Ogg_FOUND AND NOT TARGET Ogg::ogg)
64+
add_library(Ogg::ogg UNKNOWN IMPORTED)
65+
set_target_properties(
66+
Ogg::ogg
67+
PROPERTIES IMPORTED_LOCATION "${_ogg_library}"
68+
INTERFACE_COMPILE_OPTIONS "${_ogg_compile_options}"
69+
INTERFACE_INCLUDE_DIRECTORIES "${Ogg_INCLUDE_DIR}"
70+
INTERFACE_LINK_LIBRARIES "${_ogg_link_libraries}"
71+
INTERFACE_LINK_DIRECTORIES "${_ogg_link_directories}")
72+
73+
# Set additional variables for compatibility with upstream config
74+
set(Ogg_INCLUDE_DIRS "${Ogg_INCLUDE_DIR}")
75+
set(Ogg_LIBRARY Ogg::ogg)
76+
set(Ogg_LIBRARIES Ogg::ogg)
77+
set(OGG_INCLUDE_DIR "${${Ogg_INCLUDE_DIR}}")
78+
set(OGG_INCLUDE_DIRS "${${Ogg_INCLUDE_DIR}}")
79+
set(OGG_LIBRARY Ogg::ogg)
80+
set(OGG_LIBRARIES Ogg::ogg)
81+
set(OGG_FOUND TRUE)
82+
endif()
83+
84+
mark_as_advanced(_ogg_library)

0 commit comments

Comments
 (0)