mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
vcpkg: fix sndfile FluidSynth option
* Ignore `C:/Strawberry/perl` PATH in Windows-2022 image. Turns out it contains a broken pkg-config. * Remove PkgConfigHelper. * Restore "*.sf3" soundfonts loading.
This commit is contained in:
parent
e334052144
commit
8c33950982
3
.github/workflows/win_msvc.yml
vendored
3
.github/workflows/win_msvc.yml
vendored
@ -56,7 +56,8 @@ jobs:
|
|||||||
-DCMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON -DENABLE_LTO=ON `
|
-DCMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON -DENABLE_LTO=ON `
|
||||||
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
|
-DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
|
||||||
-DVCPKG_TARGET_TRIPLET="${{ matrix.arch }}-windows-static-release" `
|
-DVCPKG_TARGET_TRIPLET="${{ matrix.arch }}-windows-static-release" `
|
||||||
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets"
|
-DVCPKG_OVERLAY_TRIPLETS="cmake/triplets" `
|
||||||
|
-DCMAKE_IGNORE_PATH="C:/Strawberry/perl/bin;C:/Strawberry/c/lib"
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build
|
run: cmake --build build
|
||||||
|
@ -58,15 +58,9 @@ check_include_file("dirent.h" HAVE_DIRENT_H)
|
|||||||
check_symbol_exists(strcasecmp "strings.h" HAVE_DECL_STRCASECMP)
|
check_symbol_exists(strcasecmp "strings.h" HAVE_DECL_STRCASECMP)
|
||||||
check_symbol_exists(strncasecmp "strings.h" HAVE_DECL_STRNCASECMP)
|
check_symbol_exists(strncasecmp "strings.h" HAVE_DECL_STRNCASECMP)
|
||||||
|
|
||||||
include(PkgConfigHelper)
|
|
||||||
|
|
||||||
option(CMAKE_FIND_PACKAGE_PREFER_CONFIG
|
option(CMAKE_FIND_PACKAGE_PREFER_CONFIG
|
||||||
"Lookup package config files before using find modules" ON)
|
"Lookup package config files before using find modules" ON)
|
||||||
|
|
||||||
if(VCPKG_TOOLCHAIN)
|
|
||||||
set(ENV{PKG_CONFIG_PATH} "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib/pkgconfig")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Library requirements.
|
# Library requirements.
|
||||||
find_package(SDL2 2.0.18 REQUIRED)
|
find_package(SDL2 2.0.18 REQUIRED)
|
||||||
find_package(SDL2_net REQUIRED)
|
find_package(SDL2_net REQUIRED)
|
||||||
@ -77,7 +71,7 @@ if(SndFile_VERSION VERSION_GREATER_EQUAL "1.1.0")
|
|||||||
set(HAVE_SNDFILE_MPEG TRUE)
|
set(HAVE_SNDFILE_MPEG TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(FluidSynth 2.2.0)
|
find_package(FluidSynth)
|
||||||
find_package(libxmp)
|
find_package(libxmp)
|
||||||
|
|
||||||
if(FluidSynth_FOUND)
|
if(FluidSynth_FOUND)
|
||||||
|
@ -31,8 +31,6 @@ The following cache variables may also be set:
|
|||||||
|
|
||||||
``FluidSynth_INCLUDE_DIR``
|
``FluidSynth_INCLUDE_DIR``
|
||||||
The directory containing ``FluidSynth.h``.
|
The directory containing ``FluidSynth.h``.
|
||||||
``FluidSynth_DLL``
|
|
||||||
The path to the FluidSynth Windows runtime.
|
|
||||||
``FluidSynth_LIBRARY``
|
``FluidSynth_LIBRARY``
|
||||||
The path to the FluidSynth library.
|
The path to the FluidSynth library.
|
||||||
|
|
||||||
@ -47,64 +45,27 @@ find_path(
|
|||||||
HINTS "${PC_FLUIDSYNTH_INCLUDEDIR}"
|
HINTS "${PC_FLUIDSYNTH_INCLUDEDIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_file(
|
|
||||||
FluidSynth_DLL
|
|
||||||
NAMES fluidsynth.dll libfluidsynth.dll libfluidsynth-3.dll
|
|
||||||
PATH_SUFFIXES bin
|
|
||||||
HINTS "${PC_FLUIDSYNTH_PREFIX}"
|
|
||||||
)
|
|
||||||
|
|
||||||
find_library(
|
find_library(
|
||||||
FluidSynth_LIBRARY
|
FluidSynth_LIBRARY
|
||||||
NAMES fluidsynth libfluidsynth
|
NAMES fluidsynth libfluidsynth
|
||||||
HINTS "${PC_FLUIDSYNTH_LIBDIR}"
|
HINTS "${PC_FLUIDSYNTH_LIBDIR}"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(FluidSynth_DLL OR FluidSynth_LIBRARY MATCHES ".so|.dylib")
|
|
||||||
set(_fluidsynth_library_type SHARED)
|
|
||||||
else()
|
|
||||||
set(_fluidsynth_library_type STATIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_flags_from_pkg_config("${_fluidsynth_library_type}" "PC_FLUIDSYNTH" "_fluidsynth")
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(
|
find_package_handle_standard_args(
|
||||||
FluidSynth
|
FluidSynth
|
||||||
REQUIRED_VARS "FluidSynth_LIBRARY" "FluidSynth_INCLUDE_DIR")
|
REQUIRED_VARS "FluidSynth_LIBRARY" "FluidSynth_INCLUDE_DIR"
|
||||||
|
VERSION_VAR "FluidSynth_VERSION")
|
||||||
|
|
||||||
if(FluidSynth_FOUND)
|
if(FluidSynth_FOUND)
|
||||||
if(NOT TARGET FluidSynth::libfluidsynth)
|
if(NOT TARGET FluidSynth::libfluidsynth)
|
||||||
add_library(FluidSynth::libfluidsynth ${_fluidsynth_library_type} IMPORTED)
|
add_library(FluidSynth::libfluidsynth UNKNOWN IMPORTED)
|
||||||
set_target_properties(
|
|
||||||
FluidSynth::libfluidsynth
|
|
||||||
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_DIR}"
|
|
||||||
INTERFACE_COMPILE_OPTIONS "${_fluidsynth_compile_options}"
|
|
||||||
INTERFACE_LINK_LIBRARIES "${_fluidsynth_link_libraries}"
|
|
||||||
INTERFACE_LINK_DIRECTORIES "${_fluidsynth_link_directories}"
|
|
||||||
INTERFACE_LINK_OPTIONS "${_fluidsynth_link_options}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(FluidSynth_DLL)
|
|
||||||
set_target_properties(
|
|
||||||
FluidSynth::libfluidsynth
|
|
||||||
PROPERTIES IMPORTED_LOCATION "${FluidSynth_DLL}"
|
|
||||||
IMPORTED_IMPLIB "${FluidSynth_LIBRARY}"
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
set_target_properties(
|
set_target_properties(
|
||||||
FluidSynth::libfluidsynth
|
FluidSynth::libfluidsynth
|
||||||
PROPERTIES IMPORTED_LOCATION "${FluidSynth_LIBRARY}"
|
PROPERTIES IMPORTED_LOCATION "${FluidSynth_LIBRARY}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_DIR}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(FluidSynth_LIBRARIES FluidSynth::libfluidsynth)
|
|
||||||
set(FluidSynth_INCLUDE_DIRS "${FluidSynth_INCLUDE_DIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(
|
mark_as_advanced(FluidSynth_INCLUDE_DIR FluidSynth_LIBRARY)
|
||||||
FluidSynth_INCLUDE_DIR
|
|
||||||
FluidSynth_DLL
|
|
||||||
FluidSynth_LIBRARY
|
|
||||||
)
|
|
||||||
|
@ -9,19 +9,12 @@
|
|||||||
find_package(PkgConfig QUIET)
|
find_package(PkgConfig QUIET)
|
||||||
pkg_check_modules(PC_SndFile QUIET sndfile)
|
pkg_check_modules(PC_SndFile QUIET sndfile)
|
||||||
|
|
||||||
set(SndFile_VERSION ${PC_SndFile_VERSION})
|
|
||||||
|
|
||||||
find_path(SndFile_INCLUDE_DIR sndfile.h
|
find_path(SndFile_INCLUDE_DIR sndfile.h
|
||||||
HINTS
|
HINTS
|
||||||
${PC_SndFile_INCLUDEDIR}
|
${PC_SndFile_INCLUDEDIR}
|
||||||
${PC_SndFile_INCLUDE_DIRS}
|
${PC_SndFile_INCLUDE_DIRS}
|
||||||
${SNDFILE_DIR})
|
${SNDFILE_DIR})
|
||||||
|
|
||||||
find_file(SndFile_DLL
|
|
||||||
NAMES sndfile.dll libsndfile.dll libsndfile-1.dll
|
|
||||||
PATH_SUFFIXES bin
|
|
||||||
HINTS ${PC_SndFile_PREFIX})
|
|
||||||
|
|
||||||
find_library(SndFile_LIBRARY
|
find_library(SndFile_LIBRARY
|
||||||
NAMES sndfile libsndfile
|
NAMES sndfile libsndfile
|
||||||
HINTS
|
HINTS
|
||||||
@ -29,14 +22,6 @@ find_library(SndFile_LIBRARY
|
|||||||
${PC_SndFile_LIBRARY_DIRS}
|
${PC_SndFile_LIBRARY_DIRS}
|
||||||
${SNDFILE_DIR})
|
${SNDFILE_DIR})
|
||||||
|
|
||||||
if(SndFile_DLL OR SndFile_LIBRARY MATCHES ".so|.dylib")
|
|
||||||
set(_sndfile_library_type SHARED)
|
|
||||||
else()
|
|
||||||
set(_sndfile_library_type STATIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
get_flags_from_pkg_config("${_sndfile_library_type}" "PC_SndFile" "_sndfile")
|
|
||||||
|
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args(SndFile
|
find_package_handle_standard_args(SndFile
|
||||||
REQUIRED_VARS
|
REQUIRED_VARS
|
||||||
@ -47,29 +32,12 @@ find_package_handle_standard_args(SndFile
|
|||||||
|
|
||||||
if(SndFile_FOUND)
|
if(SndFile_FOUND)
|
||||||
if(NOT TARGET SndFile::sndfile)
|
if(NOT TARGET SndFile::sndfile)
|
||||||
add_library(SndFile::sndfile ${_sndfile_library_type} IMPORTED)
|
add_library(SndFile::sndfile UNKNOWN IMPORTED)
|
||||||
set_target_properties(SndFile::sndfile
|
set_target_properties(SndFile::sndfile
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIR}"
|
IMPORTED_LOCATION "${SndFile_LIBRARY}"
|
||||||
INTERFACE_COMPILE_OPTIONS "${_sndfile_compile_options}"
|
INTERFACE_INCLUDE_DIRECTORIES "${SndFile_INCLUDE_DIR}")
|
||||||
INTERFACE_LINK_LIBRARIES "${_sndfile_link_libraries}"
|
|
||||||
INTERFACE_LINK_DIRECTORIES "${_sndfile_link_directories}"
|
|
||||||
INTERFACE_LINK_OPTIONS "${_sndfile_link_options}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SndFile_DLL)
|
|
||||||
set_target_properties(SndFile::sndfile
|
|
||||||
PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${SndFile_DLL}"
|
|
||||||
IMPORTED_IMPLIB "${SndFile_LIBRARY}")
|
|
||||||
else()
|
|
||||||
set_target_properties(SndFile::sndfile
|
|
||||||
PROPERTIES
|
|
||||||
IMPORTED_LOCATION "${SndFile_LIBRARY}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SndFile_LIBRARIES SndFile::sndfile)
|
|
||||||
set(SndFile_INCLUDE_DIRS "${SndFile_INCLUDE_DIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
mark_as_advanced(SndFile_LIBRARY SndFile_INCLUDE_DIR SndFile_DLL)
|
mark_as_advanced(SndFile_LIBRARY SndFile_INCLUDE_DIR)
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
# Helper for Find modules
|
|
||||||
|
|
||||||
function(get_flags_from_pkg_config _library_type _pc_prefix _out_prefix)
|
|
||||||
if(NOT ${_pc_prefix}_FOUND)
|
|
||||||
set(${_out_prefix}_compile_options
|
|
||||||
""
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_out_prefix}_link_libraries
|
|
||||||
""
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_out_prefix}_link_options
|
|
||||||
""
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_out_prefix}_link_directories
|
|
||||||
""
|
|
||||||
PARENT_SCOPE)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if("${_library_type}" STREQUAL "STATIC")
|
|
||||||
set(_cflags ${_pc_prefix}_STATIC_CFLAGS_OTHER)
|
|
||||||
set(_link_libraries ${_pc_prefix}_STATIC_LIBRARIES)
|
|
||||||
set(_link_options ${_pc_prefix}_STATIC_LDFLAGS_OTHER)
|
|
||||||
set(_library_dirs ${_pc_prefix}_STATIC_LIBRARY_DIRS)
|
|
||||||
else()
|
|
||||||
set(_cflags ${_pc_prefix}_CFLAGS_OTHER)
|
|
||||||
set(_link_libraries ${_pc_prefix}_LIBRARIES)
|
|
||||||
set(_link_options ${_pc_prefix}_LDFLAGS_OTHER)
|
|
||||||
set(_library_dirs ${_pc_prefix}_LIBRARY_DIRS)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# The *_LIBRARIES lists always start with the library itself
|
|
||||||
list(REMOVE_AT "${_link_libraries}" 0)
|
|
||||||
|
|
||||||
# Work around CMake's flag deduplication when pc files use `-framework A` instead of `-Wl,-framework,A`
|
|
||||||
string(REPLACE "-framework;" "-Wl,-framework," "_filtered_link_options" "${${_link_options}}")
|
|
||||||
|
|
||||||
set(${_out_prefix}_compile_options
|
|
||||||
"${${_cflags}}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_out_prefix}_link_libraries
|
|
||||||
"${${_link_libraries}}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_out_prefix}_link_options
|
|
||||||
"${_filtered_link_options}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
set(${_out_prefix}_link_directories
|
|
||||||
"${${_library_dirs}}"
|
|
||||||
PARENT_SCOPE)
|
|
||||||
endfunction()
|
|
@ -124,7 +124,7 @@ static void AddSoundFont(const char *path)
|
|||||||
static void ScanDir(const char *dir)
|
static void ScanDir(const char *dir)
|
||||||
{
|
{
|
||||||
glob_t *glob = I_StartMultiGlob(dir, GLOB_FLAG_NOCASE|GLOB_FLAG_SORTED,
|
glob_t *glob = I_StartMultiGlob(dir, GLOB_FLAG_NOCASE|GLOB_FLAG_SORTED,
|
||||||
"*.sf2", NULL);
|
"*.sf2", "*.sf3", NULL);
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
const char *filename = I_NextGlob(glob);
|
const char *filename = I_NextGlob(glob);
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
"libsndfile",
|
"libsndfile",
|
||||||
{
|
{
|
||||||
"name": "fluidsynth",
|
"name": "fluidsynth",
|
||||||
"default-features": false
|
"default-features": false,
|
||||||
|
"features": ["sndfile"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "libxmp",
|
"name": "libxmp",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user