• BB_C@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      8 months ago

      I read the rest of the article, and it appears to have been partially written before support for codegen backends landing in cargo.

      The latest progress report from bjorn3 includes additional details on how to configure Cargo to use the new backend by default, without an elaborate command-line dance.

      That “latest progress report” has the relevant info ;)

      So, basically, you would add this to the top of Cargo.toml:

      cargo-features = ["codegen-backend"]
      

      Then add a custom profile, for example:

      [profile.release-dev-cl]
      inherits = "release"
      lto = "off"
      debug = "full"
      codegen-backend = "cranelift"
      

      Then build with:

      cargo build --profile release-dev-cl