2019-07-23 02:16:02 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO microsoft/mimalloc
|
2023-12-19 05:21:13 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 927b046e67783b325a6e41e3a9a6d3d78306fa1c82255defd1f3a7a60a27fd809a601f65b1b27fa38f2064e124f29856d7c0e5ccc33c54c2e4b6ebb9816d74b1
|
2019-07-23 02:16:02 +08:00
|
|
|
HEAD_REF master
|
|
|
|
PATCHES
|
|
|
|
fix-cmake.patch
|
2023-12-19 05:21:13 +08:00
|
|
|
template-param-types.diff
|
2019-07-23 02:16:02 +08:00
|
|
|
)
|
|
|
|
|
2019-08-14 11:13:55 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
2021-09-17 23:05:23 +08:00
|
|
|
FEATURES
|
|
|
|
asm MI_SEE_ASM
|
|
|
|
secure MI_SECURE
|
|
|
|
override MI_OVERRIDE
|
2019-07-23 02:16:02 +08:00
|
|
|
)
|
2020-09-23 07:38:03 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MI_BUILD_STATIC)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MI_BUILD_SHARED)
|
2021-09-17 23:05:23 +08:00
|
|
|
|
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-07-23 02:16:02 +08:00
|
|
|
OPTIONS_DEBUG
|
2021-10-14 05:48:09 +08:00
|
|
|
-DMI_DEBUG_FULL=ON
|
2019-07-23 02:16:02 +08:00
|
|
|
OPTIONS_RELEASE
|
2021-10-14 05:48:09 +08:00
|
|
|
-DMI_DEBUG_FULL=OFF
|
2019-07-23 02:16:02 +08:00
|
|
|
OPTIONS
|
2022-03-29 04:43:39 +08:00
|
|
|
-DMI_USE_CXX=ON
|
2020-03-19 15:39:00 +08:00
|
|
|
-DMI_BUILD_TESTS=OFF
|
2022-03-29 04:43:39 +08:00
|
|
|
-DMI_BUILD_OBJECT=OFF
|
2019-08-14 11:13:55 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2020-09-23 07:38:03 +08:00
|
|
|
-DMI_BUILD_STATIC=${MI_BUILD_STATIC}
|
|
|
|
-DMI_BUILD_SHARED=${MI_BUILD_SHARED}
|
2021-09-17 23:05:23 +08:00
|
|
|
-DMI_INSTALL_TOPLEVEL=ON
|
2019-07-23 02:16:02 +08:00
|
|
|
)
|
|
|
|
|
2021-09-17 23:05:23 +08:00
|
|
|
vcpkg_cmake_install()
|
2019-07-23 02:16:02 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
file(COPY
|
2021-09-17 23:05:23 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake"
|
2023-12-19 05:21:13 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/usage"
|
2021-09-17 23:05:23 +08:00
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
|
2019-07-23 02:16:02 +08:00
|
|
|
)
|
2021-12-30 03:29:15 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/mimalloc)
|
2019-07-23 02:16:02 +08:00
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
vcpkg_replace_string(
|
2021-09-17 23:05:23 +08:00
|
|
|
"${CURRENT_PACKAGES_DIR}/include/mimalloc.h"
|
2019-07-23 02:16:02 +08:00
|
|
|
"!defined(MI_SHARED_LIB)"
|
|
|
|
"0 // !defined(MI_SHARED_LIB)"
|
|
|
|
)
|
|
|
|
endif()
|
2021-09-17 23:05:23 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2019-07-23 02:16:02 +08:00
|
|
|
|
2022-11-18 15:27:14 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
2023-04-10 13:05:07 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|