This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
[Conan] Copy the correct version of mimalloc.dll
in Debug configuration
#510
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The name of the mimalloc shared library might depend not only on the current configuration type (Debug/Release), but also on the CMake generator that Conan is using to configure/build dependencies. For instance, in my environment Conan is using "Visual Studio 17 2022" multi-config CMake generator, which results in the library named
mimalloc.dll
for both Debug and Release configurations. However it looks like if Conan would use a single-config CMake generator, then the library name for the Debug configuration would bemimalloc-debug.dll
This leads to an issue where
mimalloc.dll
wouldn't be copied to the output directory in the Debug configuration, and there would be the "mimalloc.dll was not found" runtime error on startSolution
The simplest way to copy the right DLL seems to be using the wildcard to copy all available mimalloc DLLs. That would automatically include
mimalloc-redirect.dll
as well (tagging @espkk for visibility)Tests
Tested on Windows, Visual Studio 2022. Library recompilation can be tested by removing mimalloc from Conan cache (
conan remove mimalloc
)Would be glad if someone could double-check if this fix doesn't break anything else