mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-11 05:11:33 +00:00
Improve OGG/Vorbis detection (#888)
Previously, cmake only tested for a specific version of libsndfile and then assumed, it has OGG/Vorbis support. However, libsndfile may still be compiled without OGG/Vorbis support. If this is the case, fluidsynth should refuse to load SF3 files. Otherwise the attempt to load SF3 files would fail with a bunch of error messages. The solution of this PR proposes to lookup the private libs listed in sndfile.pc and see whether it includes "vorbis".
This commit is contained in:
parent
cd393d863a
commit
a28a5e6d20
1 changed files with 11 additions and 2 deletions
|
@ -527,8 +527,17 @@ else(NOT enable-pkgconfig)
|
|||
pkg_check_modules ( LIBSNDFILE sndfile>=1.0.0 )
|
||||
set ( LIBSNDFILE_SUPPORT ${LIBSNDFILE_FOUND} )
|
||||
if ( LIBSNDFILE_SUPPORT )
|
||||
pkg_check_modules ( LIBSNDFILE_VORBIS sndfile>=1.0.18 )
|
||||
set ( LIBSNDFILE_HASVORBIS ${LIBSNDFILE_VORBIS_FOUND} )
|
||||
message (DEBUG "LIBSNDFILE_STATIC_LIBRARIES: ${LIBSNDFILE_STATIC_LIBRARIES}")
|
||||
message (DEBUG "LIBSNDFILE_STATIC_LINK_LIBRARIES: ${LIBSNDFILE_STATIC_LINK_LIBRARIES}")
|
||||
message (DEBUG "LIBSNDFILE_STATIC_LDFLAGS: ${LIBSNDFILE_STATIC_LDFLAGS}")
|
||||
message (DEBUG "LIBSNDFILE_STATIC_LDFLAGS_OTHER: ${LIBSNDFILE_STATIC_LDFLAGS_OTHER}")
|
||||
if ( LIBSNDFILE_STATIC_LIBRARIES MATCHES "vorbis" OR
|
||||
LIBSNDFILE_STATIC_LDFLAGS MATCHES "vorbis" OR
|
||||
LIBSNDFILE_STATIC_LDFLAGS_OTHER MATCHES "vorbis" )
|
||||
set ( LIBSNDFILE_HASVORBIS 1 )
|
||||
else ()
|
||||
message ( NOTICE "Seems like libsndfile was compiled without OGG/Vorbis support." )
|
||||
endif ()
|
||||
endif ( LIBSNDFILE_SUPPORT )
|
||||
else ( enable-libsndfile )
|
||||
unset_pkg_config ( LIBSNDFILE )
|
||||
|
|
Loading…
Reference in a new issue