CREATE_PROJECT: Update revision number support (fixes bug #3280881)

Replace existing environment variable based revision number support by a file-based method
 - Generate a special header file in the build output folder with the current revision number
 - Include the new header file from internal_version.h when a specific define is set
 - Update create_project to define SCUMMVM_INTERNAL_REVISION as needed and add the build output folder to the include path
 - Remove support for git-svn clones in the revision script (not useful anymore after the switch to git)
This commit is contained in:
Littleboy 2011-04-24 12:34:57 -04:00
parent 4f708b0212
commit 11b907ebf4
12 changed files with 86 additions and 53 deletions

View file

@ -193,7 +193,7 @@ void VisualStudioProvider::writeReferences(std::ofstream &output) {
output << "\tEndProjectSection\n";
}
void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix) {
void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int bits, const StringList &defines, const std::string &prefix, bool runBuildEvents) {
std::string warnings;
for (StringList::const_iterator i = _globalWarnings.begin(); i != _globalWarnings.end(); ++i)
warnings += *i + ';';
@ -205,6 +205,10 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
definesList += *i;
}
// Add define to include revision header
if (runBuildEvents)
definesList += "SCUMMVM_INTERNAL_REVISION;";
properties << "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\n"
"<VisualStudioPropertySheet\n"
"\tProjectType=\"Visual C++\"\n"
@ -217,7 +221,7 @@ void VisualStudioProvider::outputGlobalPropFile(std::ofstream &properties, int b
"\t\tName=\"VCCLCompilerTool\"\n"
"\t\tDisableLanguageExtensions=\"true\"\n"
"\t\tDisableSpecificWarnings=\"" << warnings << "\"\n"
"\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include\"\n"
"\t\tAdditionalIncludeDirectories=\"" << prefix << ";" << prefix << "\\engines;$(SCUMMVM_LIBS)\\include;$(TargetDir)\"\n"
"\t\tPreprocessorDefinitions=\"" << definesList << "\"\n"
"\t\tExceptionHandling=\"0\"\n"
"\t\tRuntimeTypeInfo=\"false\"\n"