Skip to content

do windeployqt for qt.shared#6323

Merged
waruqi merged 1 commit intoxmake-io:devfrom
choyy:dev
Apr 16, 2025
Merged

do windeployqt for qt.shared#6323
waruqi merged 1 commit intoxmake-io:devfrom
choyy:dev

Conversation

@choyy
Copy link
Contributor

@choyy choyy commented Apr 15, 2025

目前遇到这样一种情况:

target("qtsqlshared")
    ...
    add_rules("qt.shared")
    add_files(...)
    add_frameworks("QtCore", "QtGui", "QtWidgets", "QtSql")

target("app")
    ...
    add_rules("qt.widgetapp")
    add_files(...)
    add_deps("qtsqlshared")
    add_frameworks("QtCore", "QtGui", "QtWidgets")

对于上述程序xmake run运行正常,但在xmake install后运行会出现运行时异常,但并不是提示缺少dll文件,经排查运行异常原因是缺少qtsql所用到的这些文件:

sqldrivers/qsqlited.dll
sqldrivers/qsqlodbcd.dll
sqldrivers/qsqlpsqld.dll
...

也就是target("qtsqlshared")所需要的运行dll,在对target("qtsqlshared")执行windeployqt后上述文件正常拷贝,xmake install后运行正常,故提此pr

@waruqi waruqi added this to the v3.0.0 milestone Apr 15, 2025
@waruqi waruqi merged commit cd260b4 into xmake-io:dev Apr 16, 2025
22 checks passed
@choyy
Copy link
Contributor Author

choyy commented Apr 16, 2025

又想了一下,仅安装xmake install App,是不是也应该对其依赖的qt.shared执行windeployqt?

@waruqi
Copy link
Member

waruqi commented Apr 16, 2025

按理应该不需要,你可以测试验证下

@choyy
Copy link
Contributor Author

choyy commented Apr 16, 2025

正常仅安装主程序xmake install App时,依赖的qt.shared所需dll是不会拷贝的,使用这个pr后只有xmake install所有target才会拷贝,所以我才问xmake install App是否也应该对其依赖的qt.shared执行windeployqt

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


It shouldn't be necessary, you can test it and verify it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants