vcpkg/ports/aom/portfile.cmake

58 lines
1.7 KiB
CMake
Raw Normal View History

vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
URL "https://aomedia.googlesource.com/aom"
2024-08-16 09:31:43 +02:00
REF 8ad484f8a18ed1853c094e7d3a4e023b2a92df28 # v3.9.1
HEAD_REF main
PATCHES
aom-rename-static.diff
aom-uninitialized-pointer.diff
2024-08-16 09:31:43 +02:00
export-config.diff
)
2024-08-16 09:31:43 +02:00
vcpkg_find_acquire_program(NASM)
vcpkg_find_acquire_program(PERL)
set(aom_target_cpu "")
if(VCPKG_TARGET_IS_UWP OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE MATCHES "^arm"))
# UWP + aom's assembler files result in weirdness and build failures
# Also, disable assembly on ARM and ARM64 Windows to fix compilation issues.
set(aom_target_cpu "-DAOM_TARGET_CPU=generic")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" AND VCPKG_TARGET_IS_LINUX)
2024-08-16 09:31:43 +02:00
set(aom_target_cpu "-DENABLE_NEON=OFF")
endif()
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
${aom_target_cpu}
-DENABLE_DOCS=OFF
-DENABLE_EXAMPLES=OFF
-DENABLE_TESTDATA=OFF
-DENABLE_TESTS=OFF
-DENABLE_TOOLS=OFF
2024-08-16 09:31:43 +02:00
-DTHREADS_PREFER_PTHREAD_FLAGS=ON
"-DCMAKE_ASM_NASM_COMPILER=${NASM}"
"-DPERL_EXECUTABLE=${PERL}"
)
vcpkg_cmake_install()
2024-08-16 09:31:43 +02:00
vcpkg_cmake_config_fixup()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
2024-08-16 09:31:43 +02:00
if(VCPKG_TARGET_IS_WINDOWS AND NOT VPCKG_TARGET_IS_MINGW)
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()
2024-08-16 09:31:43 +02:00
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
2024-08-16 09:31:43 +02:00
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")