diff options
| author | Lily <47812810+LilyWangL@users.noreply.github.com> | 2019-09-24 04:49:38 +0800 |
|---|---|---|
| committer | Curtis J Bezault <curtbezault@gmail.com> | 2019-09-23 13:49:37 -0700 |
| commit | 02881e6c6dc40dd0dff3bb6a0a3fcbb66a661a70 (patch) | |
| tree | d6801ecc49f78eb984357dd253f0da23846c778f | |
| parent | ef1e925305ba25129f8370a7ad6d344ab5e64b74 (diff) | |
| download | vcpkg-02881e6c6dc40dd0dff3bb6a0a3fcbb66a661a70.tar.gz vcpkg-02881e6c6dc40dd0dff3bb6a0a3fcbb66a661a70.zip | |
[sdl2-mixer] Fix features dependency link. (#8208)
* [sdl2-mixer] Fix features dependency link libraries.
* [sdl2-mixer] Remove find_library.
* [sdl2-mixer] Fix feature name
* [sdl2-mixer] Fix feature options
| -rw-r--r-- | ports/sdl2-mixer/CMakeLists.txt | 37 | ||||
| -rw-r--r-- | ports/sdl2-mixer/CONTROL | 2 | ||||
| -rw-r--r-- | ports/sdl2-mixer/portfile.cmake | 13 |
3 files changed, 49 insertions, 3 deletions
diff --git a/ports/sdl2-mixer/CMakeLists.txt b/ports/sdl2-mixer/CMakeLists.txt index bc864cf29..96529d096 100644 --- a/ports/sdl2-mixer/CMakeLists.txt +++ b/ports/sdl2-mixer/CMakeLists.txt @@ -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 diff --git a/ports/sdl2-mixer/CONTROL b/ports/sdl2-mixer/CONTROL index 9e1bd1e80..151c64304 100644 --- a/ports/sdl2-mixer/CONTROL +++ b/ports/sdl2-mixer/CONTROL @@ -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 diff --git a/ports/sdl2-mixer/portfile.cmake b/ports/sdl2-mixer/portfile.cmake index e844c5ba5..315715dfe 100644 --- a/ports/sdl2-mixer/portfile.cmake +++ b/ports/sdl2-mixer/portfile.cmake @@ -13,9 +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 + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DSDL_MIXER_SKIP_HEADERS=ON ) @@ -26,5 +36,4 @@ vcpkg_fixup_cmake_targets() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-mixer) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-mixer/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-mixer/copyright) +file(INSTALL ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
\ No newline at end of file |
