Skip to content
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

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

AntonShalgachev
Copy link
Contributor

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 be mimalloc-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 start

Solution

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

Depending on the CMake generator and the configuration the dll name might be different. Using a wildcard seems to be the easiest way to always copy the right dll
@espkk espkk merged commit 2d3fd8d into storm-devs:develop Nov 8, 2023
4 of 5 checks passed
@AntonShalgachev AntonShalgachev deleted the fix-mimalloc-dll-name branch November 8, 2023 19:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants