2019-11-22 09:16:30 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO sewenew/redis-plus-plus
|
2023-06-22 08:54:32 +08:00
|
|
|
REF "${VERSION}"
|
2024-10-19 06:31:30 +08:00
|
|
|
SHA512 c2892ec1b2f242ee19c727cd9dd1bc4e08b9f515f5736bffee5b5a12a2f1b2eddec0ebeba7998a5abc5620bdff37b5d745abdf0d7586b89535ce0ae035988ef4
|
2019-11-22 09:16:30 +08:00
|
|
|
HEAD_REF master
|
2020-10-27 15:53:49 +08:00
|
|
|
PATCHES
|
|
|
|
fix-conversion.patch
|
2022-06-18 03:47:31 +08:00
|
|
|
fix-dependency-libuv.patch
|
2023-06-08 00:40:40 +08:00
|
|
|
fix-absolute-path.patch
|
2019-11-22 09:16:30 +08:00
|
|
|
)
|
|
|
|
|
2023-06-22 08:54:32 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
"tls" REDIS_PLUS_PLUS_USE_TLS
|
|
|
|
)
|
|
|
|
|
2020-12-02 06:16:00 +08:00
|
|
|
if("cxx17" IN_LIST FEATURES)
|
|
|
|
set(REDIS_PLUS_PLUS_CXX_STANDARD 17)
|
|
|
|
else()
|
|
|
|
set(REDIS_PLUS_PLUS_CXX_STANDARD 11)
|
|
|
|
endif()
|
|
|
|
|
2022-06-18 03:47:31 +08:00
|
|
|
set(EXTRA_OPT "")
|
|
|
|
if ("async" IN_LIST FEATURES)
|
2023-06-22 08:54:32 +08:00
|
|
|
list(APPEND EXTRA_OPT "-DREDIS_PLUS_PLUS_BUILD_ASYNC=libuv")
|
2022-06-18 03:47:31 +08:00
|
|
|
endif()
|
|
|
|
if ("async-std" IN_LIST FEATURES)
|
2023-06-22 08:54:32 +08:00
|
|
|
list(APPEND EXTRA_OPT "-DREDIS_PLUS_PLUS_ASYNC_FUTURE=std")
|
2022-06-18 03:47:31 +08:00
|
|
|
endif()
|
|
|
|
|
2021-09-28 12:11:34 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" REDIS_PLUS_PLUS_BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" REDIS_PLUS_PLUS_BUILD_SHARED)
|
2020-10-27 15:53:49 +08:00
|
|
|
|
2021-09-28 12:11:34 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2023-06-09 02:17:29 +08:00
|
|
|
DISABLE_PARALLEL_CONFIGURE
|
2020-08-20 10:45:55 +08:00
|
|
|
OPTIONS
|
2023-06-22 08:54:32 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2020-10-27 15:53:49 +08:00
|
|
|
-DREDIS_PLUS_PLUS_BUILD_STATIC=${REDIS_PLUS_PLUS_BUILD_STATIC}
|
|
|
|
-DREDIS_PLUS_PLUS_BUILD_SHARED=${REDIS_PLUS_PLUS_BUILD_SHARED}
|
2020-08-20 10:45:55 +08:00
|
|
|
-DREDIS_PLUS_PLUS_BUILD_TEST=OFF
|
2020-12-02 06:16:00 +08:00
|
|
|
-DREDIS_PLUS_PLUS_CXX_STANDARD=${REDIS_PLUS_PLUS_CXX_STANDARD}
|
2022-06-18 03:47:31 +08:00
|
|
|
${EXTRA_OPT}
|
2019-11-22 09:16:30 +08:00
|
|
|
)
|
|
|
|
|
2021-09-28 12:11:34 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-11-22 09:16:30 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2023-06-22 08:54:32 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME redis++ CONFIG_PATH share/cmake/redis++)
|
|
|
|
|
2023-07-12 02:55:18 +08:00
|
|
|
if("async" IN_LIST FEATURES)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/redis++/redis++-config.cmake"
|
|
|
|
"include(CMakeFindDependencyMacro)"
|
|
|
|
[[include(CMakeFindDependencyMacro)
|
|
|
|
find_dependency(libuv CONFIG)]])
|
|
|
|
endif()
|
|
|
|
|
2021-09-28 12:11:34 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2021-06-12 00:52:35 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-11-22 09:16:30 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
2023-06-22 08:54:32 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
2021-10-28 06:19:28 +08:00
|
|
|
|
|
|
|
vcpkg_fixup_pkgconfig()
|