Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt设置sdk不能对x86和x64同时生效 #6075

Closed
littleboss01 opened this issue Jan 13, 2025 · 3 comments
Closed

qt设置sdk不能对x86和x64同时生效 #6075

littleboss01 opened this issue Jan 13, 2025 · 3 comments
Labels

Comments

@littleboss01
Copy link

Xmake 版本

2.9.7

操作系统版本和架构

windows 11 24h2

描述问题

使用命令配合qt sdk 目录为x86 qt
xmake f --qt=D:/qt/5.15.2/msvc2019
xmake g --qt=D:/qt/5.15.2/msvc2019
执行 x86 build
报错 Qt SDK not found!
然后会自动执行 x64 build
会提示找到qt sdk checking for Qt SDK version ... 5.15.2

qt是86的 ,后续执行的build会爆 D:\qt\5.15.2\msvc2019\lib\Qt5Gui.lib : warning LNK4272:库计算机类型“x86”与目标计算机类型“x64”冲突

期待的结果

在x86下能检测到 qt sdk

工程配置

add_rules("mode.debug", "mode.release")

target("mianmail")
add_rules("qt.widgetapp")
add_headerfiles("src/.h")
add_files("src/
.cpp")
add_files("src/mainwindow.ui")
-- add files with Q_OBJECT meta (only for qt.moc)
add_files("src/mainwindow.h")

附加信息和错误日志

  • 正在执行任务: xmake f -p windows -a x86 -m debug

checking for Microsoft Visual Studio (x86) version ... 2022
checking for Microsoft C/C++ Compiler (x86) version ... 19.42.34321.1
checking for Qt SDK directory ... no
error: Qt SDK not found!

  • 终端进程“C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command xmake f -p windows -a x86 -m debug”已终止,退出代码: 1。

  • 终端将被任务重用,按任意键关闭。

  • 正在执行任务: xmake

checking for Microsoft Visual Studio (x64) version ... 2022
checking for Microsoft C/C++ Compiler (x64) version ... 19.42.34321.1
checking for Qt SDK directory ... D:/qt/5.15.2/msvc2019
checking for Qt SDK version ... 5.15.2
[ 28%]: compiling.qt.ui src\mainwindow.ui
[ 42%]: compiling.qt.moc src\mainwindow.h
[ 57%]: compiling.release src\main.cpp
[ 71%]: compiling.release src\mainwindow.cpp

@waruqi
Copy link
Member

waruqi commented Jan 13, 2025

可以调下这里

table.insert(subdirs, path.join(sdkver or "*", is_arch("x64") and "msvc*_64" or "msvc*_32", "bin"))

然后提个 pr 过来改进

@Issues-translate-bot
Copy link

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


Title: qt setting sdk cannot take effect on x86 and x64 at the same time

@Issues-translate-bot
Copy link

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


You can adjust it here

table.insert(subdirs, path.join(sdkver or "*", is_arch("x64") and "msvc*_64" or "msvc*_32", "bin"))

Then submit a PR to improve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants