Fix syslinks error using qt static lib in mingw #5202
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
问题出现在使用msys/mingw环境下,使用在使用qt5静态库编译时,xmake在
_add_qmakeprllibs
函数中读取qt lib文件夹下对应库prl文件中
QMAKE_PRL_LIBS_FOR_CMAKE
值作为syslink添加。以Qt5Core.prl为例
最终添加的syslinks为
target:add("syslinks", "-lmpr")
,-l
重复添加,造成编译时链接失败,链接错误日志如下第二处是链接时,链接顺序问题,应当先链接a文件,后链接对应prl文件中的依赖库