-
Notifications
You must be signed in to change notification settings - Fork 39
xx-go: zig support #214
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
xx-go: zig support #214
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we run all c/c++ tests also with this backend? Does xx-zig make sense?
src/xx-go
Outdated
| if command -v "$XX_TRIPLE-pkg-config" >/dev/null 2>/dev/null; then | ||
| export PKG_CONFIG="$XX_TRIPLE-pkg-config" | ||
| pkgconfig_set=1 | ||
| if command -v "zig" >/dev/null 2>/dev/null; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure we should replace CC with zig just because it is installed. I guess this would be ok if there is no clang and gcc installed. Otherwise I would expect some opt-in env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added XX_GO_PREFER_COMPILER as opt-in to use zig (defaults to clang if not set)
Yes will add tests
Hum yes might make sense for |
I will look at these as follow-up if that's fine to you |
src/test-go.bats
Outdated
| skip "Zig not supported" | ||
| fi | ||
| export CGO_ENABLED=1 | ||
| export XX_GO_PREFER_COMPILER=zig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PREFER_C_COMPILER
src/xx-info
Outdated
| echo "XX_PKG_ARCH=${XX_PKG_ARCH}" | ||
| fi | ||
| echo "XX_TRIPLE=${XX_TRIPLE}" | ||
| echo "XX_ZIG_TRIPLE=${XX_ZIG_TRIPLE}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is a bit weird to expose this in xx-info directly I think. We don't do this for other compilers with similar custom names. Maybe we should leave it to xx-go helper function for now and if we ever add xx-zig we can add smth like --print-target-triple there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good
Signed-off-by: CrazyMax <[email protected]>
cc @rumpl