How to get a release build with debugging information when using cargo?

后端 未结 2 585
长发绾君心
长发绾君心 2020-12-05 02:01

The following command

$ cargo build

produces a non-optimized build with debugging information. On the con

2条回答
  •  半阙折子戏
    2020-12-05 02:22

    Another option that I found that does not require changing Cargo.toml is to use the RUSTFLAGS environment variable:

    $ RUSTFLAGS=-g cargo build --release
    

提交回复
热议问题