Skip to content

Commit

Permalink
[libavif] Fix target config include dirs for static build
Browse files Browse the repository at this point in the history
  • Loading branch information
WangWeiLin-MV committed Nov 15, 2024
1 parent 9b5cb8e commit 5ab3d06
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
16 changes: 16 additions & 0 deletions ports/libavif/0003-merge_static_libs-include-dirs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/cmake/Modules/merge_static_libs.cmake b/cmake/Modules/merge_static_libs.cmake
index 2f4826770e..16aac576bb 100644
--- a/cmake/Modules/merge_static_libs.cmake
+++ b/cmake/Modules/merge_static_libs.cmake
@@ -52,6 +52,11 @@ function(merge_static_libs target in_target)
set(source_file ${CMAKE_CURRENT_BINARY_DIR}/${target}_depends.c)
add_library(${target} STATIC ${source_file})

+ get_target_property(include_dirs ${in_target} INTERFACE_INCLUDE_DIRECTORIES)
+ if(include_dirs)
+ target_include_directories(${target} PUBLIC ${include_dirs})
+ endif()
+
avif_collect_deps(${in_target} lib_deps)

foreach(lib ${lib_deps})
8 changes: 3 additions & 5 deletions ports/libavif/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ vcpkg_from_github(
REPO AOMediaCodec/libavif
REF "v${VERSION}"
SHA512 ba72b8d02b098f361643a073361fccafd22eaac14e46dd06378d5e7acd9853538c5d166473e1de0b020de62dac25be83e42bd57ba51f675d11e2ddf155fbfa21
HEAD_REF master
HEAD_REF main
PATCHES
disable-source-utf8.patch
0003-merge_static_libs-include-dirs.patch # https://github.com/AOMediaCodec/libavif/pull/2505
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand All @@ -19,6 +20,7 @@ vcpkg_cmake_configure(
OPTIONS
-DAVIF_BUILD_APPS=OFF
-DAVIF_BUILD_TESTS=OFF
-DAVIF_BUILD_EXAMPLES=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_libsharpyuv=ON
${FEATURE_OPTIONS}
)
Expand All @@ -27,15 +29,11 @@ vcpkg_cmake_install()

vcpkg_copy_pdbs()

# Move cmake configs
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})

# Fix pkg-config files
vcpkg_fixup_pkgconfig()

# Remove duplicate files
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
1 change: 1 addition & 0 deletions ports/libavif/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libavif",
"version-semver": "1.1.1",
"port-version": 1,
"description": "Library for encoding and decoding AVIF files",
"homepage": "https://github.com/AOMediaCodec/libavif",
"license": "BSD-2-Clause AND Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4322,7 +4322,7 @@
},
"libavif": {
"baseline": "1.1.1",
"port-version": 0
"port-version": 1
},
"libb2": {
"baseline": "0.98.1",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libavif.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e0edbb4f3eaf08a4d534c7409477e67332d57f95",
"version-semver": "1.1.1",
"port-version": 1
},
{
"git-tree": "ad9d36286110339f45b585a1bbb330273c04edad",
"version-semver": "1.1.1",
Expand Down

0 comments on commit 5ab3d06

Please sign in to comment.