2017-06-21 05:35:49 +08:00
|
|
|
vcpkg_from_github(
|
2022-08-19 04:01:55 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO xiph/opus
|
2023-04-25 08:06:22 +08:00
|
|
|
REF "v${VERSION}"
|
2024-04-19 19:55:28 +08:00
|
|
|
SHA512 ba79ad035993e7bc4c09b7d77964ba913eb0b2be33305e8a04a8c49aaab21c4d96ac828e31ae45484896105851fdfc8c305c63c8400e4481dd76c62a1c12286b
|
|
|
|
HEAD_REF main
|
2022-08-19 04:01:55 +08:00
|
|
|
PATCHES fix-pkgconfig-version.patch
|
|
|
|
)
|
2019-04-10 00:56:02 +08:00
|
|
|
|
2020-04-04 01:17:41 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2022-08-19 04:01:55 +08:00
|
|
|
FEATURES
|
2024-04-19 19:55:28 +08:00
|
|
|
avx2 AVX2_SUPPORTED
|
2020-04-04 01:17:41 +08:00
|
|
|
)
|
|
|
|
|
2022-10-25 08:07:21 +08:00
|
|
|
set(ADDITIONAL_OPUS_OPTIONS "")
|
2020-08-22 08:45:42 +08:00
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
2022-08-19 04:01:55 +08:00
|
|
|
set(STACK_PROTECTOR OFF)
|
|
|
|
string(APPEND VCPKG_C_FLAGS "-D_FORTIFY_SOURCE=0")
|
|
|
|
string(APPEND VCPKG_CXX_FLAGS "-D_FORTIFY_SOURCE=0")
|
2022-10-25 08:07:21 +08:00
|
|
|
if(VCPKG_TARGET_ARCHITECTURE MATCHES "^(ARM|arm)64$")
|
|
|
|
list(APPEND ADDITIONAL_OPUS_OPTIONS "-DOPUS_USE_NEON=OFF") # for version 1.3.1 (remove for future Opus release)
|
|
|
|
list(APPEND ADDITIONAL_OPUS_OPTIONS "-DOPUS_DISABLE_INTRINSICS=ON") # for HEAD (and future Opus release)
|
|
|
|
endif()
|
2022-09-09 05:01:20 +08:00
|
|
|
elseif(VCPKG_TARGET_IS_EMSCRIPTEN)
|
|
|
|
set(STACK_PROTECTOR OFF)
|
2020-08-22 08:45:42 +08:00
|
|
|
else()
|
2022-08-19 04:01:55 +08:00
|
|
|
set(STACK_PROTECTOR ON)
|
2020-08-22 08:45:42 +08:00
|
|
|
endif()
|
|
|
|
|
2022-08-19 04:01:55 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-04-04 01:17:41 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2023-04-25 08:06:22 +08:00
|
|
|
-DPACKAGE_VERSION=${VERSION}
|
2022-08-19 04:01:55 +08:00
|
|
|
-DOPUS_STACK_PROTECTOR=${STACK_PROTECTOR}
|
|
|
|
-DOPUS_INSTALL_PKG_CONFIG_MODULE=ON
|
|
|
|
-DOPUS_INSTALL_CMAKE_CONFIG_MODULE=ON
|
|
|
|
-DOPUS_BUILD_PROGRAMS=OFF
|
|
|
|
-DOPUS_BUILD_TESTING=OFF
|
2022-10-25 08:07:21 +08:00
|
|
|
${ADDITIONAL_OPUS_OPTIONS}
|
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
OPUS_USE_NEON
|
|
|
|
OPUS_DISABLE_INTRINSICS
|
2022-08-19 04:01:55 +08:00
|
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
2017-06-21 05:35:49 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2022-08-19 04:01:55 +08:00
|
|
|
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Opus)
|
2020-09-18 04:28:52 +08:00
|
|
|
vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m)
|
2017-06-21 05:35:49 +08:00
|
|
|
|
|
|
|
|
2022-08-19 04:01:55 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/lib/cmake"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
|
2024-04-19 19:55:28 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|