cmake target_link_libraries(...) ${mi_libraries} 应该使用 PRIVATE 吗?
作者: thehans创建于 2022年11月10日更新于 2026年9月27日
标签stale
我注意到 mimalloc 的 `CMakeLists.txt` 将系统库链接为 `PUBLIC`,无论是 `MI_BUILD_SHARED` 这里: https://GitHub.com/microsoft/mimalloc/blob/ba8c0f890314d80d830599f686eaa63aafcee880/CMakeLists.txt#L343,还是 `MI_BUILD_STATIC` 这里: https://GitHub.com/microsoft/mimalloc/blob/ba8c0f890314d80d830599f686eaa63aafcee880/CMakeLists.txt#L373,在我看来,将其链接为 PRIVATE 更为合适。
内容来源: microsoft/mimalloc