Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdl2-mixer] Fix features dependency link. #8208

Merged
merged 4 commits into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ports/sdl2-mixer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,43 @@ set(SDL_MIXER_LIBRARIES SDL2::SDL2)
# builtin formats
set(SDL_MIXER_DEFINES MUSIC_WAV)

# MP3 support
if(SDL_MIXER_ENABLE_MP3)
find_path(MPG123_INCLUDE_DIR mpg123.h)
list(APPEND SDL_MIXER_INCLUDES ${MPG123_INCLUDE_DIR})
list(APPEND SDL_MIXER_DEFINES MUSIC_MP3_MPG123)
endif()

# FLAC support
if(SDL_MIXER_ENABLE_FLAC)
find_path(FLAC_INCLUDE_DIR FLAC/all.h)
list(APPEND SDL_MIXER_INCLUDES ${FLAC_INCLUDE_DIR})
list(APPEND SDL_MIXER_DEFINES MUSIC_FLAC)
endif()

# MOD support
if(SDL_MIXER_ENABLE_MOD)
find_path(MODPLUG_INCLUDE_DIR libmodplug/modplug.h)
list(APPEND SDL_MIXER_INCLUDES ${MODPLUG_INCLUDE_DIR})
list(APPEND SDL_MIXER_DEFINES MUSIC_MOD_MODPLUG)
endif()

# Ogg-Vorbis support
if(SDL_MIXER_ENABLE_OGGVORBIS)
find_path(VORBIS_INCLUDE_DIR vorbis/codec.h)
list(APPEND SDL_MIXER_INCLUDES ${VORBIS_INCLUDE_DIR})
list(APPEND SDL_MIXER_DEFINES MUSIC_OGG)
endif()

# Opus support
if(SDL_MIXER_ENABLE_OPUS)
find_path(OPUS_INCLUDE_DIR opus/opusfile.h)
find_package(ogg CONFIG REQUIRED)
find_package(Opus CONFIG REQUIRED)
list(APPEND SDL_MIXER_INCLUDES ${OPUS_INCLUDE_DIR})
list(APPEND SDL_MIXER_DEFINES MUSIC_OPUS)
endif()

add_library(SDL2_mixer
effect_position.c
effect_stereoreverse.c
Expand Down
2 changes: 1 addition & 1 deletion ports/sdl2-mixer/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: sdl2-mixer
Version: 2.0.4-4
Version: 2.0.4-5
Homepage: https://www.libsdl.org/projects/SDL_mixer
Description: Multi-channel audio mixer library for SDL.
Build-Depends: sdl2
Expand Down
9 changes: 9 additions & 0 deletions ports/sdl2-mixer/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ vcpkg_extract_source_archive_ex(
)
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
mpg123 SDL_MIXER_ENABLE_MP3
libflac SDL_MIXER_ENABLE_FLAC
libmodplug SDL_MIXER_ENABLE_MOD
libvorbis SDL_MIXER_ENABLE_OGGVORBIS
opusfile SDL_MIXER_ENABLE_OPUS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
${FEATURE_OPTIONS}
-DSDL_MIXER_SKIP_HEADERS=ON
)

Expand Down