aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/shared/SystemConfig.h6
-rw-r--r--src/tools/genrevision/genrevision.cpp13
2 files changed, 16 insertions, 3 deletions
diff --git a/src/shared/SystemConfig.h b/src/shared/SystemConfig.h
index b19ed77e559..06e0ebe1407 100644
--- a/src/shared/SystemConfig.h
+++ b/src/shared/SystemConfig.h
@@ -38,12 +38,12 @@
#if PLATFORM == PLATFORM_WINDOWS
# ifdef _WIN64
-# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Win64," _ENDIAN_STRING ")"
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Win64," _ENDIAN_STRING ")"
# else
-# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Win32," _ENDIAN_STRING ")"
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Win32," _ENDIAN_STRING ")"
# endif
#else
-# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Unix," _ENDIAN_STRING ")"
+# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " " _BUILD_DIRECTIVE " Hash: " _HASH " (Unix," _ENDIAN_STRING ")"
#endif
#define DEFAULT_PLAYER_LIMIT 100
diff --git a/src/tools/genrevision/genrevision.cpp b/src/tools/genrevision/genrevision.cpp
index b675afb0d07..7e304b25a7e 100644
--- a/src/tools/genrevision/genrevision.cpp
+++ b/src/tools/genrevision/genrevision.cpp
@@ -24,6 +24,8 @@
#pragma warning(disable:4996)
+std::string build_directive;
+
struct RawData
{
char hash_str[200];
@@ -298,6 +300,7 @@ std::string generateHeader(char const* rev_str, char const* date_str, char const
std::ostringstream newData;
newData << "#ifndef __REVISION_H__" << std::endl;
newData << "#define __REVISION_H__" << std::endl;
+ newData << " #define _BUILD_DIRECTIVE \"" << build_directive << "\"" << std::endl;
newData << " #define _REVISION \"" << rev_str << "\"" << std::endl;
newData << " #define _HASH \"" << hash_str << "\"" << std::endl;
newData << " #define _REVISION_DATE \"" << date_str << "\"" << std::endl;
@@ -325,6 +328,7 @@ int main(int argc, char **argv)
bool hg_prefered = true;
bool git_prefered = false;
bool svn_prefered = false;
+ bool debug = false;
std::string path;
// Call: tool {options} [path]
@@ -333,6 +337,7 @@ int main(int argc, char **argv)
// -s use svn prefered
// -r use only revision (without repo URL) (default)
// -u include repositire URL as commit URL or "rev at URL"
+ // -d compile directive debug
for (int k = 1; k <= argc; ++k)
{
if(!argv[k] || !*argv[k])
@@ -369,12 +374,20 @@ int main(int argc, char **argv)
case 'u':
use_url = true;
continue;
+ case 'd':
+ debug = true;
+ continue;
default:
printf("Unknown option %s",argv[k]);
return 1;
}
}
+ if (debug)
+ build_directive = "Debug";
+ else
+ build_directive = "Release";
+
/// new data extraction
std::string newData;