I want to write a custom build.rs
script that generates some diagrams to accompany the documentation for a crate I'm working on. I want this script to run only when I run cargo doc
, not the other profiles (cargo build
, cargo test
, ...). What would be the best way to do that?
I was hoping that cargo would pass this info to build.rs
in the PROFILE
env variable, but that seems to only contain "debug" or "release".
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…