fix: use WINDOWS_EXPORT_ALL_SYMBOLS and fix DLL install path on Windows - #581
fix: use WINDOWS_EXPORT_ALL_SYMBOLS and fix DLL install path on Windows#581kt286 wants to merge 1 commit into
Conversation
|
Hi @kt286. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adjusts the CMake configuration for the core library to correctly export symbols on Windows and to install built DLLs into the appropriate runtime (bin) directory by splitting target installation per component. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider wrapping
WINDOWS_EXPORT_ALL_SYMBOLS ONin a Windows-only condition (e.g.,if(WIN32)) to avoid applying this property on non-Windows platforms where it has no effect or could be confusing. - If
${LIB_NAME}can be built as a static library, you may want to guardWINDOWS_EXPORT_ALL_SYMBOLSwith a check for a shared library target to avoid unexpected behavior or warnings in static builds.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider wrapping `WINDOWS_EXPORT_ALL_SYMBOLS ON` in a Windows-only condition (e.g., `if(WIN32)`) to avoid applying this property on non-Windows platforms where it has no effect or could be confusing.
- If `${LIB_NAME}` can be built as a static library, you may want to guard `WINDOWS_EXPORT_ALL_SYMBOLS` with a check for a shared library target to avoid unexpected behavior or warnings in static builds.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
c39d551 to
3b4bce6
Compare
Separate install destinations for LIBRARY, ARCHIVE and RUNTIME to ensure DLL files are installed to the bin directory on Windows instead of lib. fix: Windows 平台 DLL 安装到 bin 目录 分离 LIBRARY、ARCHIVE 和 RUNTIME 的安装路径,确保 Windows 平台的 DLL 文件安装到 bin 目录而非 lib 目录。
3b4bce6 to
9b9ffc3
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kt286 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
1 similar comment
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kt286 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- If the intent is to move DLLs only on Windows, consider wrapping the
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}change in aWIN32or platform-specific condition to avoid altering install layouts on other platforms.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If the intent is to move DLLs only on Windows, consider wrapping the `RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}` change in a `WIN32` or platform-specific condition to avoid altering install layouts on other platforms.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Add WINDOWS_EXPORT_ALL_SYMBOLS ON to the library target properties, enabling automatic symbol export on Windows without needing compiler-specific linker flags.
Also split the install(TARGETS) command into per-component destinations (LIBRARY, ARCHIVE, RUNTIME) so that DLL files are installed to the bin directory on Windows, which is required by the Windows runtime loader.
fix: 在 Windows 上使用 WINDOWS_EXPORT_ALL_SYMBOLS 并修复 DLL 安装路径
为库 target 添加 WINDOWS_EXPORT_ALL_SYMBOLS ON 属性,在 Windows 上自动 导出符号,无需使用编译器特定的链接器标志。
同时将 install(TARGETS) 拆分为按组件指定安装目录(LIBRARY、ARCHIVE、 RUNTIME),使 DLL 文件在 Windows 上安装到 bin 目录,符合 Windows 运行时 加载器的要求。
Summary by Sourcery
Configure Windows library symbol exports and install runtime DLLs to the appropriate binary directory.
Bug Fixes:
Enhancements: