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?
You can set
build-override
'sopt-level
to3
. Beware that this will also optimize proc macros and build dependencies.