Closed eminfedar closed 9 months ago
I need to pass an environment variable which I generate on build.rs in my project.
build.rs
build.rs:
fn main() { println!("cargo:rustc-env=MY_PATH=/path/here"); }
main.rs:
fn main() { include_dir!("$MY_PATH"); // doesn't work include_dir!(env!("MY_PATH")); // doesn't work either }
If only I run my cargo build command like this, it works:
MY_PATH=/path/here cargo build
I think it should work with others too. Because users should be able to embed a directory which generated by build.rs dynamically.
I need to pass an environment variable which I generate on
build.rs
in my project.build.rs:
main.rs:
If only I run my cargo build command like this, it works:
I think it should work with others too. Because users should be able to embed a directory which generated by build.rs dynamically.