is there a way to generic portable solution to versioning of an exec file?
ie: like creating a string buffer filled with __DATE__ and __TIME__ macros, and stuffing them "somewhere", so that whenever the exe is relinked (not compiled!) it gets updated?
executable version (compile vs link time)
I don't know of anything that isn't compiler or build-process dependent.
What's the problem you need to solve?
What's the problem you need to solve?
well, if I do something like:
pVersion is "latest" only when full rebuild is on, or when it is being force recompiled. What I would like is to trigger recompile of this obj, for any modified file in the solution, which has effect on target exec. This is basically the file creation time, but from "code"
makes sense?
class TVersion {
public:
static char formatbuffer[1024];
int major;
int minor;
const char *date;
const char *time;
public:
TVersion(int vmajor, int vminor)
{
major = vmajor;
minor = vminor;
date = __DATE__;
time = __TIME__;
//
sprintf( formatbuffer, "%d.%d.%s.%s", major, minor, date, time );
}
};
main.cpp:
TVersion gVersion( 1, 1 );
pVersion = &gVersion;
pVersion is "latest" only when full rebuild is on, or when it is being force recompiled. What I would like is to trigger recompile of this obj, for any modified file in the solution, which has effect on target exec. This is basically the file creation time, but from "code"
makes sense?
I have seen an addon for visual studio once, which would do the job. It was used to edit a resource-file that holds the file-data automatically on every build.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement