diff --git a/contrib/vcpkg/portfile.cmake b/contrib/vcpkg/portfile.cmake index 47bf30cb..058ce985 100644 --- a/contrib/vcpkg/portfile.cmake +++ b/contrib/vcpkg/portfile.cmake @@ -2,14 +2,14 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO microsoft/mimalloc HEAD_REF master - + # The "REF" can be a commit hash, branch name (dev2), or a version (v2.2.1). # REF "v${VERSION}" - REF 3f91c9f937d9a7b26c130393925e7364a26c7880 + REF be05b232e8a51e076aae6d8f4a5c3049ce51cb01 - # The sha512 is the hash of the tar.gz bundle. - # (To get the sha512, run `./vcpkg install mimalloc --overlay-ports=` and copy the sha from the error message.) - SHA512 bb29283e95786c064ce6fa5a36488dafa85f7e979afe3d8fc1361997c978d13557ed27904dda9b8d29c576ad32d7dff5c674dc60c7a5891224e3f1f56bbae73c + # The sha512 is the hash of the tar.gz bundle. + # (To get the sha512, run `vcpkg install mimalloc[override] --overlay-ports=` and copy the sha from the error message.) + SHA512 24f640db050d6263e557fe9d024e6c0435762118605c0d04801efbcb32e96382b0b995000715fc0c2dcd67c67825a100a6690ecf0ef097b0a3ae107a82d74f7d ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -19,7 +19,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS secure MI_SECURE override MI_OVERRIDE xmalloc MI_XMALLOC - asm MI_SEE_ASM + asm MI_SEE_ASM ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MI_BUILD_STATIC) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MI_BUILD_SHARED) diff --git a/contrib/vcpkg/readme.md b/contrib/vcpkg/readme.md index a001cdb0..b1f6047c 100644 --- a/contrib/vcpkg/readme.md +++ b/contrib/vcpkg/readme.md @@ -7,12 +7,14 @@ your own variant. For example, you can edit the [`portfile.cmake`](portfile.cmake) to check out a specific commit, version, or branch of mimalloc, or set further options. You can install such custom port as: + ```sh -$ vcpkg install mimalloc --overlay-ports=./contrib/vcpkg +$ vcpkg install mimalloc[override] --recurse --overlay-ports=./contrib/vcpkg ``` This will also show the correct sha512 hash if you use a custom version. -See the vcpkg [documentation](https://learn.microsoft.com/en-us/vcpkg/produce/update-package-version) for more information. +Another way is to refer to the overlay from the [vcpkg-configuration.json](https://learn.microsoft.com/en-us/vcpkg/reference/vcpkg-configuration-json) file. +See also the vcpkg [documentation](https://learn.microsoft.com/en-us/vcpkg/produce/update-package-version) for more information. # Using mimalloc from vcpkg @@ -25,6 +27,8 @@ find_package(mimalloc CONFIG REQUIRED) target_link_libraries(main PRIVATE mimalloc) ``` +See [`test/CMakeLists.txt](../../test/CMakeLists.txt) for more examples. + # Acknowledgements diff --git a/contrib/vcpkg/usage b/contrib/vcpkg/usage index 08f79c97..7ce649a7 100644 --- a/contrib/vcpkg/usage +++ b/contrib/vcpkg/usage @@ -15,7 +15,6 @@ And use mimalloc in your sources as: return 0; } -When dynamically overriding on Windows, ensure `mimalloc.dll` is linked -through some call to the mimalloc API, e.g. `mi_version()`, and that -the `mimalloc-redirect.dll` is in the same directory. +When dynamically overriding on Windows, ensure `mimalloc.dll` is linked through some call to +mimalloc (e.g. `mi_version()`), and that the `mimalloc-redirect.dll` is in the same directory. See https://github.com/microsoft/mimalloc/blob/dev/bin/readme.md for detailed information.