diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg | |
Diffstat (limited to 'vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg')
4 files changed, 259 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake new file mode 100644 index 0000000..dd25706 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/portfile.cmake @@ -0,0 +1,10 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${CURRENT_PORT_DIR}/project" + OPTIONS + "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" +) +vcpkg_cmake_build() diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/project/CMakeLists.txt b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/project/CMakeLists.txt new file mode 100644 index 0000000..0759a0b --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/project/CMakeLists.txt @@ -0,0 +1,34 @@ +cmake_minimum_required(VERSION 3.30) +project(ffmpeg-test C) + +find_package(FFMPEG REQUIRED) + +add_executable(main main.c) +target_include_directories(main PRIVATE ${FFMPEG_INCLUDE_DIRS}) +target_link_directories(main PRIVATE ${FFMPEG_LIBRARY_DIRS}) +target_link_libraries(main PRIVATE ${FFMPEG_LIBRARIES}) + +# FAQ: using the static lib in a shared lib +# https://ffmpeg.org/platform.html#Advanced-linking-configuration +if(UNIX AND NOT BUILD_SHARED_LIBS) + add_library(shared SHARED main.c) + target_include_directories(shared PRIVATE ${FFMPEG_INCLUDE_DIRS}) + target_link_directories(shared PRIVATE ${FFMPEG_LIBRARY_DIRS}) + target_link_libraries(shared PRIVATE ${FFMPEG_LIBRARIES}) + if(NOT APPLE) + target_link_options(shared PRIVATE -Wl,-Bsymbolic) + endif() +endif() + + +find_package(PkgConfig REQUIRED) +pkg_check_modules(ffmpeg_pc + libavcodec libavfilter libavutil libswscale libavdevice libavformat libswresample + REQUIRED + IMPORTED_TARGET +) + +add_executable(main-pkconfig main.c) +target_link_libraries(main-pkconfig PRIVATE + PkgConfig::ffmpeg_pc +) diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/project/main.c b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/project/main.c new file mode 100644 index 0000000..ae557e4 --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/project/main.c @@ -0,0 +1,11 @@ +#include <stdio.h> +#include "libavcodec/avcodec.h" +#include "libavutil/avutil.h" + +int main() +{ + char codecVersions[256]; + avcodec_find_encoder(AV_CODEC_ID_H264); + printf("ffmpeg version: %s\n", av_version_info()); + return 0; +} diff --git a/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json new file mode 100644 index 0000000..27dc9ec --- /dev/null +++ b/vcpkg/scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json @@ -0,0 +1,204 @@ +{ + "name": "vcpkg-ci-ffmpeg", + "version-string": "ci", + "description": "Port to force features of certain ports within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "dependencies": [ + { + "name": "ffmpeg", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + } + ], + "default-features": [ + "ci" + ], + "features": { + "ci": { + "description": "vcpkg CI feature configuration", + "dependencies": [ + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "avcodec", + "avdevice", + "avfilter", + "avformat", + "avresample", + "bzip2", + "freetype", + "gpl", + "iconv", + "lzma", + "mp3lame", + "nonfree", + "openh264", + "openjpeg", + "openmpt", + "openssl", + "opus", + "postproc", + "snappy", + "soxr", + "speex", + "swresample", + "swscale", + "theora", + "vorbis", + "vpx", + "webp", + "xml2", + "zlib" + ] + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "alsa" + ], + "platform": "linux" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "sdl2" + ], + "platform": "!osx" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "ass", + "dvdvideo", + "ffmpeg", + "fontconfig", + "fribidi", + "modplug", + "opencl", + "srt" + ], + "platform": "!uwp" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "fdk-aac" + ], + "platform": "!android" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "ilbc" + ], + "platform": "!(arm & uwp)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "ssh" + ], + "platform": "!(uwp | arm)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "x264" + ], + "platform": "!(arm & windows)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "drawtext" + ], + "platform": "!(uwp | android)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "dav1d" + ], + "platform": "!(uwp | arm | x86 | osx)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "aom" + ], + "platform": "!(windows & arm) & !uwp" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "x265" + ], + "platform": "!uwp & !(arm & windows)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "avisynthplus" + ], + "platform": "windows & !arm & !uwp & !static" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "tesseract" + ], + "platform": "!(windows & arm) & !static & !uwp" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "opengl" + ], + "platform": "!uwp & !(arm64 & windows) & !android" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "qsv" + ], + "platform": "!arm & (android | linux | windows) & !uwp" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "nvcodec" + ], + "platform": "!android & !osx & !uwp & !(arm64 & windows)" + }, + { + "name": "ffmpeg", + "default-features": false, + "features": [ + "vulkan" + ], + "platform": "(linux | windows) & !arm & !uwp" + } + ] + } + } +} |