-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
需要改进对 zig 编译器的支持 #5915
Comments
Title: Need to improve zig compiler support Xmake versionv2.9.6+20241030 Operating system version and architectureManjaro Linux Describe the problemGenerally, there is a need to use zig to compile C/C++ projects. xmake already has preliminary support for this, but testing found that there are still some aspects that need improvement.
Expected results
local opt = {
system = false
}
add_requireconfs('**|cmake|pkg-config', opt)
Project configurationN/A Additional information and error logsN/A |
这个在语言层面是没法自动处理的,你只能自己配置 system = false 不走系统, 或者
没时间,可以来个 pr 过来。
这个可以参考 gcc/clang/msvc ,在 toolchain 中增加支持的 runtimes ,比如 glibc 等 xmake/xmake/toolchains/gcc/xmake.lua Line 31 in 71a5624
然后在 zig rules 中取 runtimes 处理下,可以来个 pr 过来 |
Xmake 版本
v2.9.6+20241030
操作系统版本和架构
Manjaro Linux
描述问题
一般有需要使用 zig 编译 C/C++ 项目的需求,xmake 对此已经有了初步支持,但测试发现仍然有些方面需要改进。
对于系统包的处理
zig 默认不导入系统包,而 xmake 的默认行为恰好与之相反,这将导致头文件查找问题。
依赖库编译的工具链
zig 基于 llvm 工具链构建,与 linux 下常用的 gcc 工具链(以及对应包)兼容性往往存在问题。
glibc 版本选择
zig 支持在 target 中传入 glibc 版本(doc),xmake 尚不支持。
Compiling a cmake project with zig c++ doesn't resolve to and absolute path #5610
期待的结果
考虑在文档中写明兼容问题,或者添加警告?
添加一个
glibc_version
参数工程配置
N/A
附加信息和错误日志
N/A
The text was updated successfully, but these errors were encountered: