Jump to content
  • Advertisement
Sign in to follow this  
zfvesoljc

executable version (compile vs link time)

This topic is 2560 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
I don't know of anything that isn't compiler or build-process dependent.

What's the problem you need to solve?

Share this post


Link to post
Share on other sites
well, if I do something like:

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!