How to set an env variable that lasts until the building finishes?

How to set an env variable using config.toml or Cargo.toml that lasts for the end of the building time.

Setting it in config.toml doesn't help because I want to use some combined values as follows.

[env]
VAR="${pwd}/d --g ${pwd}/aaa"

Note that I can't use build.rs too because I want the env var to be set until the building finishes.

Depending on your shell, there might be a way to do this directly from the shell. For example, in Bash:

VAR="the value" cargo build

I don't want to use the shell. because there are more variables and this is not cross platform solution..

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.