On Unix, we have the following practice:
The command for the final executable has a timestamp automatically added:
app: ${OBJ}
date +"extern const double VERSION=%Y%m%d.%H%M%S" > version.cpp
gcc version.cpp ${OBJ} -o app
In VS, the Custom Build Step can be used to create version.cpp. However, I don't see any way to include it on the build line.
If I introduce a dummy file and make a custom build rule to generate version.cpp all the time, it will end up forcing a new link when nothing else changed -- on Unix, only when sth. changes the link command will be invoked.
Is there any way to do this in Visual Studio?
The command for the final executable has a timestamp automatically added:
app: ${OBJ}
date +"extern const double VERSION=%Y%m%d.%H%M%S" > version.cpp
gcc version.cpp ${OBJ} -o app
In VS, the Custom Build Step can be used to create version.cpp. However, I don't see any way to include it on the build line.
If I introduce a dummy file and make a custom build rule to generate version.cpp all the time, it will end up forcing a new link when nothing else changed -- on Unix, only when sth. changes the link command will be invoked.
Is there any way to do this in Visual Studio?