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

MSVC 使用 HOSTX64 工具链 #5077

Closed
yecate opened this issue May 9, 2024 · 11 comments
Closed

MSVC 使用 HOSTX64 工具链 #5077

yecate opened this issue May 9, 2024 · 11 comments

Comments

@yecate
Copy link
Contributor

yecate commented May 9, 2024

你在什么场景下需要该功能?

编译 x86 的debug 程序 默认使用的是 Hostx86\x86 工具链
当链接很多Lib(LLVM) 在链接link的时候会爆内存

描述可能的解决方案

希望能切换到 MSVC\14.40.33807\bin\Hostx64\x86 工具链

描述你认为的候选方案

No response

其他信息

No response

@Issues-translate-bot
Copy link

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


Title: MSVC uses HOSTX64 toolchain

In what scenario do you need this function?

Compile the x86 debug program. The Hostx86\x86 tool chain is used by default.
When linking a lot of Lib (LLVM), the memory will be exhausted when linking.

Describe possible solutions

Hope to switch to MSVC\14.40.33807\bin\Hostx64\x86 toolchain

Describe your alternatives

No response

other information

No response

waruqi added a commit that referenced this issue May 9, 2024
@waruqi
Copy link
Member

waruqi commented May 9, 2024

这个 patch 应该可以支持,#5079

不过目前我没低版本 vs ,也许还需要对低版本 vs 做下测试和兼容。。我不确定有些参数,低版本vs是否支持

@waruqi waruqi added this to the v2.9.2 milestone May 9, 2024
@yecate
Copy link
Contributor Author

yecate commented May 9, 2024

2019/2022 已经正常切换到HostX64

xmake g -c
configure
{
    clean = true
    proxy_pac = pac.lua
    network = public
    theme = default
}
xmake f -a x86 -cvD
checking for platform ... windows
checking for vswhere.exe ... C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
checking for cl.exe ... K:\IDE\vs2022\VC\Tools\MSVC\14.40.33807\bin\HostX64\x86\cl.exe
checking for Microsoft Visual Studio (x86) version ... 2022
checking for Microsoft C/C++ Compiler (x86) version ... 19.40.33808
xmake f -a x86 --vs=2019 -cvD
checking for platform ... windows
checking for cl.exe ... C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX64\x86\cl.exe
checking for Microsoft Visual Studio (x86) version ... 2019

但是切换vs 2005/2008/2010 未能正确识别到vs

xmake f -a x86 --vs=2010 -cvD
checking for platform ... windows
checking for cl.exe ... K:\IDE\vs2022\VC\Tools\MSVC\14.40.33807\bin\HostX64\x86\cl.exe
checking for Microsoft Visual Studio (x86) version ... 2022
checking for Microsoft C/C++ Compiler (x86) version ... 19.40.33808

@waruqi
Copy link
Member

waruqi commented May 9, 2024

2005 2008 的 vcvarsall.bat 文件发我看下

@yecate
Copy link
Contributor Author

yecate commented May 9, 2024

@Issues-translate-bot
Copy link

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


This patch should support it, #5079

However, I don’t have a lower version of VS at the moment. Maybe I need to test and make compatibility with the lower version of VS. . I'm not sure whether some parameters are supported by lower version vs.

@Issues-translate-bot
Copy link

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


Send me the vcvarsall.bat file of 2005 and 2008 for a look.

@waruqi
Copy link
Member

waruqi commented May 10, 2024

再试试,我限制了下,仅仅对 2019 开启 host arch 支持

@yecate
Copy link
Contributor Author

yecate commented May 10, 2024

功能正常了

@waruqi waruqi closed this as completed May 10, 2024
waruqi added a commit that referenced this issue May 10, 2024
@Issues-translate-bot
Copy link

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


Try again, I restricted it and only enabled host arch support for 2019.

@Issues-translate-bot
Copy link

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


Function is normal

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

No branches or pull requests

3 participants