2021-06-01 22:20:31 +03:00
|
|
|
# NASM is required to build AOM
|
|
|
|
vcpkg_find_acquire_program(NASM)
|
|
|
|
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
|
|
|
|
vcpkg_add_to_path(${NASM_EXE_PATH})
|
|
|
|
|
|
|
|
# Perl is required to build AOM
|
|
|
|
vcpkg_find_acquire_program(PERL)
|
|
|
|
get_filename_component(PERL_PATH ${PERL} DIRECTORY)
|
|
|
|
vcpkg_add_to_path(${PERL_PATH})
|
|
|
|
|
|
|
|
vcpkg_from_git(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
URL "https://aomedia.googlesource.com/aom"
|
2024-02-06 03:31:32 +08:00
|
|
|
REF bb6430482199eaefbeaaa396600935082bc43f66
|
2021-06-01 22:20:31 +03:00
|
|
|
PATCHES
|
|
|
|
aom-rename-static.diff
|
2022-10-26 07:10:47 +03:00
|
|
|
aom-uninitialized-pointer.diff
|
2021-06-01 22:20:31 +03:00
|
|
|
# Can be dropped when https://bugs.chromium.org/p/aomedia/issues/detail?id=3029 is merged into the upstream
|
|
|
|
aom-install.diff
|
|
|
|
)
|
|
|
|
|
2022-04-29 11:40:30 -07:00
|
|
|
set(aom_target_cpu "")
|
2023-01-07 17:15:07 +08:00
|
|
|
if(VCPKG_TARGET_IS_UWP OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "^arm"))
|
2022-04-29 11:40:30 -07:00
|
|
|
# UWP + aom's assembler files result in weirdness and build failures
|
2023-01-07 17:15:07 +08:00
|
|
|
# Also, disable assembly on ARM and ARM64 Windows to fix compilation issues.
|
2022-04-29 11:40:30 -07:00
|
|
|
set(aom_target_cpu "-DAOM_TARGET_CPU=generic")
|
|
|
|
endif()
|
|
|
|
|
2023-11-17 22:27:31 +00:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_TARGET_IS_LINUX)
|
|
|
|
set(aom_target_cpu "-DENABLE_NEON=OFF")
|
|
|
|
endif()
|
|
|
|
|
2021-06-01 22:20:31 +03:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
|
|
|
OPTIONS
|
2022-04-29 11:40:30 -07:00
|
|
|
${aom_target_cpu}
|
2021-06-01 22:20:31 +03:00
|
|
|
-DENABLE_DOCS=OFF
|
|
|
|
-DENABLE_EXAMPLES=OFF
|
|
|
|
-DENABLE_TESTDATA=OFF
|
|
|
|
-DENABLE_TESTS=OFF
|
|
|
|
-DENABLE_TOOLS=OFF
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-10-27 17:02:23 +11:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2024-04-30 20:50:26 +02:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/aom.pc" " -lm" "")
|
|
|
|
if(NOT VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/aom.pc" " -lm" "")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2021-06-01 22:20:31 +03:00
|
|
|
# Move cmake configs
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})
|
|
|
|
|
|
|
|
# Remove duplicate files
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/share)
|
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
2021-12-08 04:34:46 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|