forked from sociomantic-tsunami/makd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Version.d.tpl
128 lines (109 loc) · 3.48 KB
/
Version.d.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*******************************************************************************
Version information generated at compile time.
This file is automatically generated.
DO NOT CHANGE, IT WILL BE OVERWRITTEN
DO NOT ADD TO THE REPOSITORY
Copyright:
Template source Copyright (c) 2014-2016 Sociomantic Labs GmbH.
Generated code based on this template is owned by the user who ran the
generation.
License:
Template source is distributed under Boost Software License Version 1.0.
Generated code based on this template is determined by the user who ran
the generation.
*******************************************************************************/
module @MODULE@;
// Use weird symbols name to minimize risk of clashing with identical aliases
// from generic D2 transition helper module. Module itself is not imported
// here to minimize external makd dependencies.
version (D_Version2)
{
mixin("alias immutable(char)[] _tpl_istring;");
}
else
{
alias char[] _tpl_istring;
}
_tpl_istring[_tpl_istring] versionInfo;
deprecated("Please use @[email protected] instead (part of the D2 transition)")
alias versionInfo Version;
static this()
{
versionInfo["version"] = "@VERSION@";
versionInfo["build_date"] = "@DATE@";
versionInfo["build_author"] = "@AUTHOR@";
versionInfo["compiler"] = "@COMPILER@";
@LIBRARIES@
buildPredefinedVersions();
}
/*******************************************************************************
Store predefined versions that are defined while compiling in the global
variable Versions.
*******************************************************************************/
private void buildPredefinedVersions()
{
mixin(Id!("DigitalMars"));
mixin(Id!("GNU"));
mixin(Id!("LDC"));
mixin(Id!("SDC"));
mixin(Id!("D_NET"));
mixin(Id!("Windows"));
mixin(Id!("Win32"));
mixin(Id!("Win64"));
mixin(Id!("linux"));
mixin(Id!("OSX"));
mixin(Id!("FreeBSD"));
mixin(Id!("OpenBSD"));
mixin(Id!("BSD"));
mixin(Id!("Solaris"));
mixin(Id!("Posix"));
mixin(Id!("AIX"));
mixin(Id!("SkyOS"));
mixin(Id!("SysV3"));
mixin(Id!("SysV4"));
mixin(Id!("Hurd"));
mixin(Id!("Cygwin"));
mixin(Id!("MinGW"));
mixin(Id!("X86"));
mixin(Id!("X86_64"));
mixin(Id!("ARM"));
mixin(Id!("PPC"));
mixin(Id!("PPC64"));
mixin(Id!("IA64"));
mixin(Id!("MIPS"));
mixin(Id!("MIPS64"));
mixin(Id!("SPARC"));
mixin(Id!("SPARC64"));
mixin(Id!("S390"));
mixin(Id!("S390X"));
mixin(Id!("HPPA"));
mixin(Id!("HPPA64"));
mixin(Id!("SH"));
mixin(Id!("SH64"));
mixin(Id!("Alpha"));
mixin(Id!("LittleEndian"));
mixin(Id!("BigEndian"));
mixin(Id!("D_Coverage"));
mixin(Id!("D_Ddoc"));
mixin(Id!("D_InlineAsm_X86"));
mixin(Id!("D_InlineAsm_X86_64"));
mixin(Id!("D_LP64"));
mixin(Id!("D_PIC"));
}
/*******************************************************************************
Adds the `name` to the `Version` global (key "ver_name", value "name") iff
version (name) is defined.
*******************************************************************************/
private template Id (_tpl_istring name)
{
version (D_Version2)
{
mixin("static immutable Id = `version (` ~ name ~ `) versionInfo[\"ver_`
~ name ~ `\"] = \"` ~ name ~ `\";`;");
}
else
{
const _tpl_istring Id = `version (` ~ name ~ `) versionInfo["ver_` ~ name ~
`"] = "` ~ name ~ `";`;
}
}