mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Change the way the version is printed (more verbose, with short hash)
If the user has patches managed by the mq extension, the version and hash printed are those of the qparent revision (the revision the patches were applied on top of) instead of tip. Also fixes a bug: print LLVM revision even if there are local modifications to it. Sorry for the long line in the perl file. I have no idea how to break it up.
This commit is contained in:
@@ -9,8 +9,8 @@ my $llvm_src = `perl @LLVM_CONFIG@ --src-root`;
|
||||
|
||||
my $llvm_rev = `svnversion $llvm_src`;
|
||||
|
||||
if ($llvm_rev =~ s/(\d+)\s+$/$1/) {
|
||||
$llvm_rev = qq!#define LLVM_REV "LLVM rev.$llvm_rev"!
|
||||
if ($llvm_rev =~ s/(\d+M?)\s+$/$1/) {
|
||||
$llvm_rev = qq!#define LLVM_REV "LLVM rev. $llvm_rev"!
|
||||
} else {
|
||||
my $llvm_lib = `perl @LLVM_CONFIG@ --libdir`;
|
||||
$llvm_lib =~ s/\s+$//;
|
||||
@@ -18,13 +18,13 @@ if ($llvm_rev =~ s/(\d+)\s+$/$1/) {
|
||||
$llvm_rev = qq!#include "llvm/Config/config.h"\n#define LLVM_REV PACKAGE_STRING" ($llvm_rev)"!;
|
||||
}
|
||||
|
||||
my $ldc_rev = `hg -R@PROJECT_SOURCE_DIR@ tip --template {rev}`;
|
||||
my $ldc_rev = `hg -R@PROJECT_SOURCE_DIR@ log -r qparent --template '{rev}:{node|short} ({date|isodate})' 2>/dev/null || hg -R@PROJECT_SOURCE_DIR@ tip --template '{rev}:{node|short} ({date|isodate})'`;
|
||||
|
||||
my $out = qq!#ifndef LDC_VERSIONS_H
|
||||
#define LDC_VERSIONS_H
|
||||
|
||||
$llvm_rev
|
||||
#define LDC_REV "rev.$ldc_rev"
|
||||
#define LDC_REV "rev. $ldc_rev"
|
||||
|
||||
#endif // LDC_VERSIONS_H\n!;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user