Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
proton-c-0.39.0
-
None
Description
Cross-compiling with `zig cc`/`zig c++` is a very useful feature.
Here are some references how it works and why it is so nice
- https://ziglang.org/learn/overview/#cross-compiling-is-a-first-class-use-case
- https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html
- https://jakstys.lt/2022/how-uber-uses-zig/
- https://www.uber.com/en-CZ/blog/bootstrapping-ubers-infrastructure-on-arm64-with-zig/
- https://www.youtube.com/watch?v=SCj2J3HcEfc
What currently happens when compiling with CXX='zig c++' is the following
Building CXX object CMakeFiles/cmTC_44138.dir/testCXXCompiler.cxx.o /usr/local/bin/zig -o CMakeFiles/cmTC_44138.dir/testCXXCompiler.cxx.o -c /build/proton/app/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx info: Usage: zig [command] [options]
That is, it drops the `c+` part of the command line. This seems to happen when compiling proton-c in the check for a working C+ compiler (to optionally enable tests in C++)