Supporting cc and linker config flag taking additonal arguments

As can be seen in this issue and this article. Supporting arguments instead of binary name/path in linker and cc config flags can simplify cross compilation. (I don't find any mention to cc config flag but I will assume it exist here, alternatively even if CC env variable supported this it would be nice).

For example, having the following config supported would make cross compilation to aarch64-apple-darwin work smoothly as long you have zig installed. You could use cargo-zigbuild but I think having it possible as config would simplify this usage as any one using the project can continue using cargo directly without knowing about cargo zigbuild.

[target.aarch64-apple-darwin]
cc = "zig cc -target aarch64-macos"
linker = "zig cc -target aarch64-macos"

This topic is for discussion, but if there are no reason not do this then I am interested in implementing this feature.

It would be even better if cross compilation work out of box without zig cc, but I think this can be very effective solution short/medium term.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.