I want to be able to provide a variable via a command line at compile time
MY_VAR="my_var1" cargo build
# or
MY_VAR="my_var111" cargo build
# or
MY_VAR="my_varfdsafdsafds" cargo build
and a library should be compiled with the value of a variable and see that value in its code. A library must not resolve a variable at runtime, but at compile time.
I don't consider changing the code of a library in any way, nor .cargo/config
, nor Cargo.toml
How can I do it? Is it possible?