2019-11-22 09:03:32 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO xiph/flac
|
2022-04-27 10:26:07 +08:00
|
|
|
REF 1151c93e992bb8c7c6394e04aa880d711c531c7f #1.3.4
|
|
|
|
SHA512 ebf8de3dbd8fc2153af2f4a05ecc04817570233c30e0ec1fbdbc99f810860801b951248ca6404152cba4038f5839985f4076bcee477c00fd23bd583a45b89b17
|
2019-11-22 09:03:32 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
2020-10-28 11:34:03 +08:00
|
|
|
uwp-library-console.patch
|
|
|
|
uwp-createfile2.patch
|
|
|
|
fix-compile-options.patch
|
2019-11-22 09:03:32 +08:00
|
|
|
)
|
|
|
|
|
2020-08-08 02:42:21 +08:00
|
|
|
if(VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(WITH_STACK_PROTECTOR OFF)
|
2021-11-30 04:02:52 +08:00
|
|
|
string(APPEND VCPKG_C_FLAGS " -D_FORTIFY_SOURCE=0")
|
|
|
|
string(APPEND VCPKG_CXX_FLAGS " -D_FORTIFY_SOURCE=0")
|
2020-08-08 02:42:21 +08:00
|
|
|
else()
|
|
|
|
set(WITH_STACK_PROTECTOR ON)
|
|
|
|
endif()
|
|
|
|
|
2020-10-28 11:34:03 +08:00
|
|
|
if("asm" IN_LIST FEATURES)
|
|
|
|
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
|
|
|
|
message(FATAL_ERROR "Feature asm only supports x86 architecture.")
|
|
|
|
endif()
|
2020-11-11 01:34:50 +08:00
|
|
|
|
|
|
|
VCPKG_FIND_ACQUIRE_PROGRAM(NASM)
|
|
|
|
GET_FILENAME_COMPONENT(NASM_PATH ${NASM} DIRECTORY)
|
|
|
|
vcpkg_add_to_path("${NASM_PATH}")
|
2020-10-28 11:34:03 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2022-04-27 10:26:07 +08:00
|
|
|
FEATURES
|
|
|
|
asm WITH_ASM
|
2020-10-28 11:34:03 +08:00
|
|
|
)
|
|
|
|
|
2022-04-27 10:26:07 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2020-10-28 11:34:03 +08:00
|
|
|
OPTIONS ${FEATURE_OPTIONS}
|
2020-05-22 02:19:21 +08:00
|
|
|
-DBUILD_PROGRAMS=OFF
|
|
|
|
-DBUILD_EXAMPLES=OFF
|
|
|
|
-DBUILD_DOCS=OFF
|
2020-08-01 02:23:27 +08:00
|
|
|
-DBUILD_TESTING=OFF
|
2020-08-08 02:42:21 +08:00
|
|
|
-DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR})
|
2019-11-22 09:03:32 +08:00
|
|
|
|
2022-04-27 10:26:07 +08:00
|
|
|
vcpkg_cmake_install()
|
|
|
|
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME FLAC CONFIG_PATH share/FLAC/cmake)
|
2020-10-28 11:34:03 +08:00
|
|
|
|
2019-11-22 09:03:32 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2021-11-30 04:02:52 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-11-22 09:03:32 +08:00
|
|
|
|
2020-08-01 02:23:27 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2021-11-30 04:02:52 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
2020-08-01 02:23:27 +08:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 0"
|
|
|
|
)
|
2021-11-30 04:02:52 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
2020-08-01 02:23:27 +08:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 0"
|
|
|
|
)
|
|
|
|
else()
|
2021-11-30 04:02:52 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
2020-08-01 02:23:27 +08:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 1"
|
|
|
|
)
|
2021-11-30 04:02:52 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
2020-08-01 02:23:27 +08:00
|
|
|
"#if defined(FLAC__NO_DLL)"
|
|
|
|
"#if 1"
|
|
|
|
)
|
|
|
|
endif()
|
2022-04-27 10:26:07 +08:00
|
|
|
|
2021-11-30 04:02:52 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac.pc" " -lm" "")
|
2022-04-27 10:26:07 +08:00
|
|
|
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc" " -lm" "")
|
2021-11-30 04:02:52 +08:00
|
|
|
endif()
|
|
|
|
endif()
|
2022-04-27 10:26:07 +08:00
|
|
|
|
2021-11-30 04:02:52 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-10-28 11:34:03 +08:00
|
|
|
|
2019-11-22 09:03:32 +08:00
|
|
|
# This license (BSD) is relevant only for library - if someone would want to install
|
|
|
|
# FLAC cmd line tools as well additional license (GPL) should be included
|
2021-11-30 04:02:52 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING.Xiph" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|