CMAKE是否支持Windows上的延迟加载DLL?
我正在将MSBuild项目转换为CMAKE项目(IDE是Visual Studio 2022)。
MSBUILD属性页面允许设置所选的DLL被“延迟加载”,但是在线搜索搜索使我找不到有关类似标志或配置设置的信息,无法在我的cmakelists.txt中启用此cmake build时,当我设置target_link_libraries()。
我是否缺少使用CMAKE_变量或其他命令来执行此操作的方法,还是这根本不是Cmake的支持功能,因为它已进化为Linux工具,并且延迟加载并不是真正的事情?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Cmake 3.24中,这将是可能的,这是我编写此答案时的第二个版本候选人。
我不确定这些围绕这些的最佳实践是什么。在某些情况下,可能需要将上述代码段包括在其导出文件中。可能不是可执行文件的问题,但很可能是库。
This will be possible in CMake 3.24, which is on its second release candidate as I write this answer.
I'm not sure what the best practices surrounding these will be. One might need to include the above code snippet in their export files under some circumstances. Probably not an issue for executables, but might well be for libraries.
https://cmake.org/cmake/help/latest/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.html