How to have build.rs built and run in release mode?

109 views Asked by At

I have a build.rs that generates tables. They are expensive to calculate and I would like to run build.rs in release mode. However, it seems it always runs in debug mode regardless of build profile selected.

This issue discusses this specifically, and is closed, but I'm unable to extract the tidbit that allows me to run build.rs in release mode regardless of the build profile I'm using. How do I do this?

1

There are 1 answers

0
Chayim Friedman On

You can set build-override's opt-level to 3. Beware that this will also optimize proc macros and build dependencies.