As part of the build process, I need to take the environment variable defined by the script package and use it as a constant in the code at compile time.
For example, suppose I defined an environment variable with the name BUILD_VERSIONand set it to 1.0.0, when it compiles, I want to 1.0.0bake into my code. EG:
Batch file:
set BUILD_VERSION = 1.0.0
; call vs compiler
C ++ file:
const std::string build_version = BUILD_VERSION
How should I do it?
source
share