-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdub.sdl
219 lines (190 loc) · 6.25 KB
/
dub.sdl
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
name "alicedbg"
description "Aiming to be a simple debugger"
homepage "http://github.com/dd86k/alicedbg"
authors "dd86k <[email protected]>"
copyright "Copyright © dd86k <[email protected]>"
license "BSD-3-Clause-Clear"
# NOTE: BetterC flag
# We explicitly specify the betterC flag to support older DUB releases
# Like v0.9.24
# NOTE: GDC 5.4
# Doesn't work, ld whines about missing _tlsstart/_tlsend (TLS) references
# value for C++/ObjC but not D:
# -fno-rtti
# -fno-weak
# -fno-threadsafe-statics
# -fextern-tls-init
# -fno-switch-errors: not a command-line option
# -nophoboslib: makes the linker complain more
# Tried with "-fno-moduleinfo" "-fno-emit-moduleinfo"
# NOTE: GDC and betterC
# Currently (even with GDC 10.3), when compiled with -fno-druntime
# (similar to -betterC), the linker will whine about an undefined reference
# to __gdc_personality_v0, because the gdc-druntime defines this reference.
# Glibc (and subsequently, GCC) has a similiar function,
# __gcc_personality_v0, that is served when unwinding the stack, so to
# handle exceptions.
# NOTE: GDC 11.1 and betterC
# Yes, it works with -fno-druntime, so it can be possible to add
# -gdc-betterc build types in the future.
# NOTE: Configurations and Sub-Packages
# Sub-packages do not take build type options from root dub file.
# But since configurations do, they are defined here, this is important
# because on the reliance on betterC.
#
# ANCHOR Configurations
#
# Application: Debugger (alicedbg)
configuration "debugger" {
targetType "executable"
targetName "alicedbg"
sourcePaths "debugger" "common"
importPaths "debugger" "common"
mainSourceFile "debugger/main.d"
}
# Application: Dumper (alicedump)
configuration "dumper" {
targetType "executable"
targetName "alicedump"
sourcePaths "dumper" "common"
importPaths "dumper" "common"
mainSourceFile "dumper/main.d"
}
# Application: Example (simple)
configuration "simple" {
targetType "executable"
targetName "simple"
mainSourceFile "examples/simple.d"
}
# Library
# NOTE: DUB names it "alicedbg.lib" on Windows and "libalicedbg.a" elsewhere
configuration "library" {
versions "StaticLib"
sourcePaths "src"
}
# Dynamic library/Shared object
# NOTE: DUB names it "alicedbg.dll" on Windows and "libalicedbg.so" elsewhere
# NOTE: MSVC Linker can't find vcruntime140.lib with libs declaration
# LIBPATH isn't compiler-provided one, but Windows SDK
configuration "shared" {
targetType "dynamicLibrary"
versions "SharedLib" # "Shared" might confuse druntime
sourcePaths "src"
}
#
# ANCHOR Build types
#
## Debug builds
# Debug build with tracing enabled. This will be extremely verbose and the
# output will be cryptid.
# Only to be used with small reproductible bugs.
buildType "trace" {
versions "Trace" "AdbgTrace"
buildOptions "debugMode" "debugInfo"
dflags "-betterC" "-vgc" "-vtls" platform="dmd"
dflags "-betterC" "--vgc" platform="ldc"
dflags "-ftransition=nogc" "-ftransition=tls" platform="gdc"
}
# Make the compiler print GC and TLS usage, and target information.
buildType "debugv" {
versions "DebugV" "PrintTargetInfo"
buildOptions "debugMode" "debugInfo"
dflags "-betterC" "-vgc" "-vtls" platform="dmd"
dflags "-betterC" "--vgc" platform="ldc"
dflags "-ftransition=nogc" "-ftransition=tls" platform="gdc"
}
# Ditto but aimed for older compiler version
# Like older dmd versions, ldc 0.17.1, and gdc 6.0
buildType "debugv0" {
versions "DebugV0" "PrintTargetInfo"
buildOptions "debugMode" "debugInfo"
dflags "-vgc" "-vtls" platform="dmd"
dflags "--vgc" platform="ldc"
dflags "-ftransition=nogc" "-ftransition=tls" "-fno-exceptions" "-fno-bounds-check" "-fno-assert" "-fno-builtin" platform="gdc"
}
# Make the compiler verbose instead of DUB.
buildType "debugvv" {
versions "DebugVV"
buildOptions "debugMode" "debugInfo"
dflags "-betterC" "-v" platform="dmd"
dflags "-betterC" "-v" platform="ldc"
dflags "-v" platform="gdc"
}
# Compile in debug mode.
buildType "debug" {
versions "Debug"
buildOptions "debugMode" "debugInfo"
dflags "-betterC" platform="dmd"
dflags "-betterC" platform="ldc"
}
## Release builds
# Compile in release mode.
buildType "release" {
versions "Release"
buildOptions "releaseMode" "optimize" "noBoundsCheck"
dflags "-betterC" platform="dmd"
dflags "-betterC" platform="ldc"
}
# Compile in release mode with debug info.
buildType "release-debug" {
versions "Release"
buildOptions "releaseMode" "optimize" "noBoundsCheck" "debugInfo"
dflags "-betterC" platform="dmd"
dflags "-betterC" platform="ldc"
}
## Release-Static builds
# NOTE: DMD and GDC static builds tend to work better under glibc environments.
# Compile in release mode as statically linked.
buildType "release-static" {
versions "Release"
buildOptions "releaseMode" "optimize" "noBoundsCheck"
dflags "-betterC" "-L=-static" platform="dmd"
dflags "-fno-druntime" "-Wl,-static" platform="gdc"
dflags "-betterC" "--static" platform="ldc"
}
# Compile in release mode as statically linked.
buildType "release-debug-static" {
versions "Release"
buildOptions "releaseMode" "optimize" "noBoundsCheck" "debugInfo"
dflags "-betterC" "-L=-static" platform="dmd"
dflags "-fno-druntime" "-Wl,-static" platform="gdc"
dflags "-betterC" "--static" platform="ldc"
}
#
# ANCHOR Integration tests
#
# NOTE: These MUST be ran as "dub test -b TEST"
# NOTE: Dedicated tests must only exist if one of these conditions are met
# - Requires user input (e.g., readline)
# - Are prone to crashing application (e.g., longjmp on Windows)
#
buildType "setjmp" {
buildOptions "unittests"
sourceFiles "tests/setjmp.d"
sourcePaths "src"
}
buildType "readkey" {
buildOptions "unittests"
sourceFiles "tests/readkey.d" "app/term.d"
}
buildType "readln" {
buildOptions "unittests"
sourceFiles "tests/readln.d" "app/term.d"
}
#
# ANCHOR Documentation build types
#
# NOTE: Documentation (docs/ddox) builds
# Works best with the "library" configuration (-c|--configuration)
# to avoid DUB peek in other import directories.
#
buildType "docs" {
buildRequirements "allowWarnings"
buildOptions "syntaxOnly"
dflags "-Dddocs"
}
buildType "ddox" {
buildRequirements "allowWarnings"
buildOptions "syntaxOnly"
dflags "-Dddocs" "-Df__dummy.html" "-Xfdocs.json"
}