mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-28 06:07:49 +08:00
c9e786d81a
* Bulk remove vcpkg_fail_port_install calls. Interesting ones have been split out into separate reviews, where "interesting" means "anything more than just deleting the call to vcpkg_fail_port_install", In support of https://github.com/microsoft/vcpkg/pull/21502 * Update version database. * Revert google benchmark changes already submitted as https://github.com/microsoft/vcpkg/pull/22728 * Repair version database.
59 lines
1.7 KiB
CMake
59 lines
1.7 KiB
CMake
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO microsoft/mimalloc
|
|
REF v2.0.3
|
|
SHA512 275a5249d09a57c9a039714fc6eef24ae778496954972419f3ac8e33f3d12e9837ba0691a3c08a4ab807c26b868aad3a5b2c28ee10ecaa60fe21ffe1d416f08f
|
|
HEAD_REF master
|
|
PATCHES
|
|
fix-cmake.patch
|
|
)
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
asm MI_SEE_ASM
|
|
secure MI_SECURE
|
|
override MI_OVERRIDE
|
|
)
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MI_BUILD_STATIC)
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MI_BUILD_SHARED)
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS_DEBUG
|
|
-DMI_DEBUG_FULL=ON
|
|
OPTIONS_RELEASE
|
|
-DMI_DEBUG_FULL=OFF
|
|
OPTIONS
|
|
-DMI_INTERPOSE=ON
|
|
-DMI_USE_CXX=OFF
|
|
-DMI_BUILD_TESTS=OFF
|
|
${FEATURE_OPTIONS}
|
|
-DMI_BUILD_STATIC=${MI_BUILD_STATIC}
|
|
-DMI_BUILD_SHARED=${MI_BUILD_SHARED}
|
|
-DMI_INSTALL_TOPLEVEL=ON
|
|
MAYBE_UNUSED_VARIABLES
|
|
MI_INTERPOSE
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(COPY
|
|
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake"
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
|
|
)
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/mimalloc)
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
vcpkg_replace_string(
|
|
"${CURRENT_PACKAGES_DIR}/include/mimalloc.h"
|
|
"!defined(MI_SHARED_LIB)"
|
|
"0 // !defined(MI_SHARED_LIB)"
|
|
)
|
|
endif()
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|