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

Xmake是否支持在plat=windows的情况下,自定义msvc的编译链 #5732

Closed
Zcaic opened this issue Oct 18, 2024 · 16 comments
Closed

Xmake是否支持在plat=windows的情况下,自定义msvc的编译链 #5732

Zcaic opened this issue Oct 18, 2024 · 16 comments
Labels
Milestone

Comments

@Zcaic
Copy link

Zcaic commented Oct 18, 2024

Xmake Version

2.9.5

Operating System Version and Architecture

Windows10

Describe Bug

我电脑由于不能联网,所以安装的是便携版的msvc,并设置好相应的PATHINLCUDE、`LIB``环境变量,用cmake是能够正确识别和编译的,但是用xmake的时候,发现会提示找不到vs。

Expected Behavior

Project Configuration

Additional Information and Error Logs

@Zcaic Zcaic added the bug label Oct 18, 2024
@Issues-translate-bot
Copy link

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


Title: Does Xmake support customizing the msvc compilation chain when plat=windows?

@waruqi
Copy link
Member

waruqi commented Oct 18, 2024

这边支持 vcvarsall.bat 的探测和加载,以及支持 vs prompt cmd 环境。。其他的环境不支持

@Issues-translate-bot
Copy link

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


This supports the detection and loading of vcvarsall.bat, as well as the vs prompt cmd environment. . Other environments are not supported

@star-hengxing
Copy link
Contributor

如果要支持,需要 config 新增几个参数专门设置 INCLUDE/LIBPATH,然后还是在 find_vstudio 基于这些值去查找吧。
这样貌似也能无缝支持 wine-msvc 的工具链,包管理那边继续走环境变量。

@Issues-translate-bot
Copy link

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


If you want to support it, you need to add several parameters to config to specifically set INCLUDE/LIBPATH, and then use find_vstudio to search based on these values.
This seems to be able to seamlessly support the wine-msvc tool chain, and the package management will continue to use environment variables.

@Zcaic
Copy link
Author

Zcaic commented Oct 18, 2024

我看了下源码,xmake好像是根据注册表去找vs的,而且构建工具好像用的是msbuild,不知道我理解的对不对

@Issues-translate-bot
Copy link

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


I looked at the source code. It seems that xmake looks for VS based on the registry, and the build tool seems to use msbuild. I don’t know if I understand it correctly.

@waruqi
Copy link
Member

waruqi commented Oct 21, 2024

跟 msbuild 有啥关系,xmake 直接调用的编译器。

环境加载依赖 vcallvars.bat 你可以自己看下源码

https://github.com/xmake-io/xmake/blob/dev/xmake/modules/detect/sdks/find_vstudio.lua

@waruqi
Copy link
Member

waruqi commented Oct 21, 2024

我没用过便携版的msvc,可以提供下 安装包,或者直接提 pr 到 xmake-repo 收录进来。后面倒是可以考虑整合进来

@Zcaic
Copy link
Author

Zcaic commented Oct 21, 2024

好的嘞,大佬,这是便携版MSVC的下载开源工具,https://github.com/Data-Oriented-House/PortableBuildTools

@Issues-translate-bot
Copy link

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


What does it have to do with msbuild, the compiler called directly by xmake.

Environment loading depends on vcallvars.bat. You can look at the source code yourself.

https://github.com/xmake-io/xmake/blob/dev/xmake/modules/detect/sdks/find_vstudio.lua

@Issues-translate-bot
Copy link

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


I have never used the portable version of msvc. You can provide the installation package, or directly upload the pr to xmake-repo for inclusion. You can consider integrating it later.

@Issues-translate-bot
Copy link

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


Okay, boss, this is the downloadable open source tool for the portable version of MSVC, https://github.com/Data-Oriented-House/PortableBuildTools

@waruqi
Copy link
Member

waruqi commented Nov 20, 2024

现在支持了 可以试下: #5848

@waruqi waruqi closed this as completed Nov 20, 2024
@waruqi waruqi added this to the v2.9.7 milestone Nov 20, 2024
@Zcaic
Copy link
Author

Zcaic commented Nov 20, 2024

强啊大佬,我晚上回去就去试试

@Issues-translate-bot
Copy link

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


It's strong, boss. I'll try it when I get back tonight.

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

4 participants