mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-24 04:39:03 +02:00
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:
@@ -17,6 +17,7 @@
|
||||
#include "dmd2/target.h"
|
||||
#include "driver/cl_options.h"
|
||||
#include "driver/configfile.h"
|
||||
#include "driver/ldc-version.h"
|
||||
#include "driver/linker.h"
|
||||
#include "driver/target.h"
|
||||
#include "driver/toobj.h"
|
||||
@@ -86,7 +87,7 @@ static cl::list<std::string, StringsAdapter> debuglibs("debuglib",
|
||||
|
||||
void printVersion() {
|
||||
printf("LDC - the LLVM D compiler (%s):\n", global.ldc_version);
|
||||
printf(" based on DMD %s and %s\n", global.version, global.llvm_version);
|
||||
printf(" based on DMD v%s and LLVM %s\n", global.version, global.llvm_version);
|
||||
printf(" Default target: %s\n", llvm::sys::getDefaultTargetTriple().c_str());
|
||||
std::string CPU = llvm::sys::getHostCPUName();
|
||||
if (CPU == "generic") CPU = "(unknown)";
|
||||
@@ -165,6 +166,9 @@ int main(int argc, char** argv)
|
||||
int status = EXIT_SUCCESS;
|
||||
|
||||
global.init();
|
||||
global.version = ldc::dmd_version;
|
||||
global.ldc_version = ldc::ldc_version;
|
||||
global.llvm_version = ldc::llvm_version;
|
||||
|
||||
// Set some default values
|
||||
#if _WIN32
|
||||
|
||||
Reference in New Issue
Block a user