-
-
Notifications
You must be signed in to change notification settings - Fork 818
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
optimize wasi detect #4798
Comments
使用 set_toolchain/set_plat 单独对特定 target 设置就行了,并不影响 |
每个人的wasi-sdk的路径都不一样。这样别人就不能方便的构建了。
我的测试项目如下:
main.cpp
|
走 set_toolchain ,你还是可以传递 另外,也可以
额外加 wasi_sdk,只会导致 config options 越来越多,不受敛,同样也没法对不同 target 处理 |
Just use set_toolchain/set_plat to set a specific target separately, and it will not affect |
Everyone's wasi-sdk path is different. In this way, others cannot easily build it.
|
When using set_toolchain , you can still pass In addition, you can also use
Adding additional wasi_sdk will only lead to more and more config options, which will not be converged, and it will also not be able to handle different targets. |
另外,更推荐的做法是把 wasi sdk 提交到 xmake-repo ,作为包,然后走 add_requires/set_toolchains 直接远程拉取,自动集成,连 --sdk 都不需要指定,目前 emsdk 就已经支持。。。 只需要 xmake 一键编译,还能支持 wasi sdk 的版本选择 |
In addition, the more recommended approach is to submit wasi sdk to xmake-repo as a package, and then use add_requires/set_toolchains to directly pull it remotely and integrate it automatically. You don’t even need to specify --sdk, which is currently supported by emsdk. . . Only one-click compilation with xmake is required, and it also supports version selection of wasi sdk |
那我把config里的删掉好了,有环境变量也足够了。自己在项目里加config、toolchain啥的比较麻烦,每个项目都得做一遍,不太方便,还是xmake能自动检测最好了。 |
Then I deleted it in the config, and the environment variables are enough. It is troublesome to add config, toolchain, etc. to the project by yourself. You have to do it again for each project, which is not convenient. It is best if xmake can automatically detect it. |
参考 https://github.com/tboox/tbox/blob/c6b0a56076941b8263e162c7fe7b0870ea44e09c/xmake.lua#L35 另外,package 里面还能自定义 on_fetch 去改进系统上已有 wasi sdk 的查找,找到就不用走 下载,更具有扩展性,也不用每次都在 xmake 加 find_xxxsdk。。 |
自动检测也可以在包里做,不需要放到 xmake 里面 |
Reference https://github.com/tboox/tbox/blob/c6b0a56076941b8263e162c7fe7b0870ea44e09c/xmake.lua#L35 In addition, on_fetch can be customized in the package to improve the search for wasi sdk already on the system. If you find it, you don’t need to download it. It is more scalable and you don’t need to add find_xxxsdk to xmake every time. . |
Automatic detection can also be done in the package, no need to put it in xmake |
Reference https://github.com/xmake-io/xmake-repo/blob/dev/packages/l/llvm/fetch.lua |
我又重新提交了,log没有中文了 |
I resubmitted, but the log no longer has Chinese characters. |
Is your feature request related to a problem? Please describe.
现在只有一种办法检测wasi-sdk。即调用命令
xmake f -p wasm -a wasm32 --toolchain=wasi --sdk=C:\\xxx
。如果一个项目中有多个target使用不同的platform和toolchain就没办法设置了(可能是我不会)。Describe the solution you'd like
希望可以通过环境变量 WASI_SDK_PATH 或者xmake全局设置来告诉xmake wasi-sdk在哪。
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: