mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Split out LLVM_REV into separate header, to reduce rebuilding when only the LDC
revision has changed.
This commit is contained in:
@@ -29,6 +29,7 @@ syntax: regexp
|
||||
^ldc\.make$
|
||||
^revisions\.pl$
|
||||
^gen/revisions\.h$
|
||||
^gen/llvm-version\.h$
|
||||
^dmd2?/idgen$
|
||||
^dmd2?/impcnvgen$
|
||||
^dmd2?/impcnvtab\.c$
|
||||
|
||||
@@ -195,7 +195,7 @@ add_custom_target(
|
||||
gen_revs_h
|
||||
COMMAND ${PERL_EXECUTABLE} ${PROJECT_BINARY_DIR}/revisions.pl
|
||||
DEPENDS ${PROJECT_BINARY_DIR}/revisions.pl
|
||||
COMMENT "Generating revisions.h"
|
||||
COMMENT "Generating revisions.h and llvm-version.h"
|
||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/gen
|
||||
)
|
||||
add_dependencies(${LDC_EXE} gen_revs_h)
|
||||
|
||||
@@ -61,7 +61,7 @@ Global::Global()
|
||||
written = "written by Walter Bright and Tomas Lindquist Olsen";
|
||||
version = "v2.021";
|
||||
ldc_version = LDC_REV;
|
||||
llvm_version = LLVM_REV;
|
||||
llvm_version = LLVM_REV_STR;
|
||||
global.structalign = 8;
|
||||
|
||||
// This should only be used as a global, so the other fields are
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef LDC_GEN_LINKAGE_H
|
||||
#define LDC_GEN_LINKAGE_H
|
||||
|
||||
#include "gen/revisions.h"
|
||||
#include "gen/llvm-version.h"
|
||||
|
||||
// Make it easier to test new linkage types
|
||||
// Also used to adapt to some changes in LLVM between 2.5 and 2.6
|
||||
|
||||
@@ -46,9 +46,6 @@ $extra_includes
|
||||
|
||||
// LLVM version string, for use in -version output
|
||||
#define LLVM_REV_STR $llvm_rev_str$llvm_date
|
||||
// LLVM svn revision number, used to adapt to changes in LLVM
|
||||
// (Is 0 if LLVM is not an SVN trunk version)
|
||||
#define LLVM_REV $llvm_rev_nr
|
||||
// LDC version string, for use in -version output
|
||||
#define LDC_REV "rev. $ldc_rev"
|
||||
|
||||
@@ -63,3 +60,21 @@ if ($old ne $out) {
|
||||
print $revh $out;
|
||||
close $revh;
|
||||
}
|
||||
|
||||
$out = qq!#ifndef LDC_LLVM_VERSION_H
|
||||
#define LDC_LLVM_VERSION_H
|
||||
|
||||
// LLVM svn revision number, used to adapt to changes in LLVM
|
||||
// (Is 0 if LLVM is not an SVN trunk version)
|
||||
#define LLVM_REV $llvm_rev_nr
|
||||
|
||||
#endif // LDC_LLVM_VERSION_H\n!;
|
||||
|
||||
$old = "";
|
||||
open $revh, "llvm-version.h" and $old = join "", <$revh>;
|
||||
|
||||
if ($old ne $out) {
|
||||
open $revh, ">llvm-version.h" or die "cannot create llvm-version.h: $!";
|
||||
print $revh $out;
|
||||
close $revh;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user