Include Git revision in version info.

CMakeLists.txt contains now the version numbers for DMD and (next) LDC release.
If a .git folder is found then the LDC version is replaced by the first 6 chars
of the Git revision.

Possible improvements:

- If the build is not done at the master branch then it could be useful to check for a tag and use the tag instead of the revision. (for release builds)
- Maybe it is useful to include the branch name.

This fixes issue #366.
This commit is contained in:
kai
2013-06-21 06:47:32 +02:00
parent 31d85d0910
commit aa143b560c
8 changed files with 219 additions and 7 deletions
-3
View File
@@ -103,9 +103,6 @@ void Global::init()
compiler.vendor = "Digital Mars D";
#endif
#if IN_LLVM
version = "v2.063";
ldc_version = "trunk";
llvm_version = "LLVM " LDC_LLVM_VERSION_STRING;
compiler.vendor = "LDC";
#endif
+2 -2
View File
@@ -341,8 +341,8 @@ struct Global
const char *version;
#if IN_LLVM
char *ldc_version;
char *llvm_version;
const char *ldc_version;
const char *llvm_version;
bool inExtraInliningSemantic;
#endif