microsoft / microsoft/mimalloc
cmake target_link_libraries(... ${mi_libraries}) should use PRIVATE ?
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 13.4k
- Forks
- 1.2k
- Avg merge
- 4d 45m
- Merged PRs (30d)
- 13
Description
I noticed that mimalloc's CMakeLists.txt links to system libraries as PUBLIC for both MI_BUILD_SHARED here:
https://github.com/microsoft/mimalloc/blob/ba8c0f890314d80d830599f686eaa63aafcee880/CMakeLists.txt#L343
and for MI_BUILD_STATIC here:
https://github.com/microsoft/mimalloc/blob/ba8c0f890314d80d830599f686eaa63aafcee880/CMakeLists.txt#L373
As far as I understand the usage of this, it would be more proper to link these as PRIVATE.
I'm wondering if this has some effect on the initialization order of imported dll, as seen in #542 (cross compile issue using cmake and MinGW)
mimalloc-redirect.dll seems to be initialized after ucrtbase.dll
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in CMakeLists.txt at the MI_BUILD_SHARED and MI_BUILD_STATIC target_link_libraries calls referenced in the issue. Review CMake's PUBLIC versus PRIVATE propagation and compare the behavior with the initialization-order concern in issue #542; done means confirming the appropriate visibility and its effect on the reported MinGW case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cmake
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100