2

Is it possible to set a certain compiler switch if a feature is enabled? For example I would like to add a feature instrument and compile everything with -Z instrument-mcount. I did take a look at the options available for .cargo/config.toml but could not find anything useful.

jens
  • 168
  • 5
  • The question cant be answered properly, as not all `rustc` flags are exposed via cargo. See [here](https://stackoverflow.com/a/38040431/9306292), what is available. – Jay-Pi Jan 18 '21 at 21:16
  • What do you mean with it cannot be answered properly? It is not possible at the moment would be a proper answer. – jens Jan 19 '21 at 14:38
  • The flag `-Z` defines unstable compiler options, which are not exposed via cargo. – Jay-Pi Jan 19 '21 at 20:37
  • Look here for a build.rs from [rftrace](https://github.com/tlambertz/rftrace/blob/master/rftrace/build.rs). – Jay-Pi Jan 19 '21 at 20:38

0 Answers0