[aom/libavif] Add support for ARM and UWP (#20636)

* Support libavif building on UWP and ARM

Remove deprecated functions

Bump port version

Apply suggestions from code review

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

Bump version

Add version all

use patches

* Add version

* Disable deprecated functions using _CRT_SECURE_NO_WARNINGS rather than disabling 4996.

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Levin Li 2021-12-08 04:34:46 +08:00 committed by GitHub
parent 431d3810aa
commit 7bb175eafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 67 additions and 18 deletions

View File

@ -0,0 +1,13 @@
diff --git a/build/cmake/aom_configure.cmake b/build/cmake/aom_configure.cmake
index 43d60ae..35c510b 100644
--- a/build/cmake/aom_configure.cmake
+++ b/build/cmake/aom_configure.cmake
@@ -265,6 +265,8 @@ if(MSVC)
# Disable MSVC warnings that suggest making code non-portable.
add_compiler_flag_if_supported("/wd4996")
+ # Disable MSVC warnings for potentially uninitialized local pointer variable.
+ add_compiler_flag_if_supported("/wd4703")
if(ENABLE_WERROR)
add_compiler_flag_if_supported("/WX")
endif()

View File

@ -1,5 +1,3 @@
vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "UWP")
# NASM is required to build AOM
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
@ -19,6 +17,7 @@ vcpkg_from_git(
aom-rename-static.diff
# Can be dropped when https://bugs.chromium.org/p/aomedia/issues/detail?id=3029 is merged into the upstream
aom-install.diff
aom-uninitialized-pointer.diff
)
vcpkg_cmake_configure(
@ -46,5 +45,5 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_fixup_pkgconfig()
vcpkg_fixup_pkgconfig()

View File

@ -1,10 +1,10 @@
{
"name": "aom",
"version-semver": "3.2.0",
"port-version": 1,
"port-version": 2,
"description": "AV1 codec library",
"homepage": "https://aomedia.googlesource.com/aom",
"supports": "!uwp & !arm",
"supports": "!(windows & arm & !uwp)",
"dependencies": [
{
"name": "vcpkg-cmake",

View File

@ -1,6 +1,3 @@
# AVIF depends on AOM, but AOM doesn't support ARM and UWP
vcpkg_fail_port_install(ON_ARCH "arm" ON_TARGET "UWP")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO AOMediaCodec/libavif

View File

@ -1,9 +1,9 @@
{
"name": "libavif",
"version-semver": "0.9.2",
"port-version": 1,
"description": "Library for encoding and decoding AVIF files",
"homepage": "https://github.com/AOMediaCodec/libavif",
"supports": "!uwp & !arm",
"dependencies": [
"aom",
"libyuv",

View File

@ -0,0 +1,16 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cc49726..25d6ff1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,11 @@ OPTION( TEST "Built unit tests" OFF )
SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON )
+if (MSVC)
+ # Allow deprecated functions
+ add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
+endif()
+
SET ( ly_base_dir ${PROJECT_SOURCE_DIR} )
SET ( ly_src_dir ${ly_base_dir}/source )
SET ( ly_inc_dir ${ly_base_dir}/include )

View File

@ -7,20 +7,20 @@ vcpkg_from_git(
PATCHES
fix_cmakelists.patch
fix-build-type.patch
deprecated-warning.patch
)
set(POSTFIX d)
vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG
-DCMAKE_DEBUG_POSTFIX=${POSTFIX}
)
vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/libyuv)
vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/libyuv)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

View File

@ -1,9 +1,18 @@
{
"name": "libyuv",
"version-date": "2021-04-15",
"port-version": 1,
"description": "libyuv is an open source project that includes YUV scaling and conversion functionality",
"homepage": "https://chromium.googlesource.com/libyuv/libyuv",
"dependencies": [
"libjpeg-turbo"
"libjpeg-turbo",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "013d95ace27d59d663acada0264327bf5382308c",
"version-semver": "3.2.0",
"port-version": 2
},
{
"git-tree": "5d7bac96c35260b96135bf3ec1d456994d549eb3",
"version-semver": "3.2.0",

View File

@ -102,7 +102,7 @@
},
"aom": {
"baseline": "3.2.0",
"port-version": 1
"port-version": 2
},
"approval-tests-cpp": {
"baseline": "10.12.1",
@ -3326,7 +3326,7 @@
},
"libavif": {
"baseline": "0.9.2",
"port-version": 0
"port-version": 1
},
"libb2": {
"baseline": "0.98.1",
@ -4098,7 +4098,7 @@
},
"libyuv": {
"baseline": "2021-04-15",
"port-version": 0
"port-version": 1
},
"libzen": {
"baseline": "0.4.38",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a160f6cf67dc99a095c98a9a7260b7a5fd110b7b",
"version-semver": "0.9.2",
"port-version": 1
},
{
"git-tree": "7e78225af6d76356499d029ed6cb0d55fa20629a",
"version-semver": "0.9.2",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "ca463baa9f197bedced2b6ad24977d4ba928c0f2",
"version-date": "2021-04-15",
"port-version": 1
},
{
"git-tree": "d3e4d6adb28f13cb3aa4978cd0d6e319b87416cb",
"version-date": "2021-04-15",