Uploaded image for project: 'Qpid Proton'
  1. Qpid Proton
  2. PROTON-2786

Cannot cross-compile proton-c using the `zig c++` compiler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • proton-c-0.39.0
    • proton-c-0.40.0
    • build
    • 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

      1. https://ziglang.org/learn/overview/#cross-compiling-is-a-first-class-use-case
      2. https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html
      3. https://jakstys.lt/2022/how-uber-uses-zig/
      4. https://www.uber.com/en-CZ/blog/bootstrapping-ubers-infrastructure-on-arm64-with-zig/
      5. 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++)

      Attachments

        Activity

          People

            jdanek Jiri Daněk
            jdanek Jiri Daněk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: