/
dub.sdl
55 lines (43 loc) · 1.61 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
name "minijson"
description "Minify JSON files"
authors "Amin Yahyaabadi"
copyright "Copyright © 2021, Amin Yahyaabadi"
license "MIT"
targetPath "./dist"
sourcePaths "./src/native"
importPaths "./src/native"
dependency "automem" version="0.6.7"
preGenerateCommands "git submodule update --init" # despacer download
dependency "despacer" path="./src/native/despacer/bindings/d"
configuration "executable" {
targetType "executable"
mainSourceFile "./src/native/cli.d"
}
configuration "library" {
targetType "library"
targetName "minijson"
}
configuration "benchmark" {
targetType "executable"
targetName "minijson-benchmark"
mainSourceFile "./benchmark/benchmark.d"
excludedSourceFiles "src/native/cli.d" "src/native/libc.d"
}
# -------- Build Options and configurations --------
// enables all disp except =nosharedaccess
dflags "-vgc" "-preview=dip25" "-preview=dip1000" "-preview=dip1008" "-preview=fieldwise" "-preview=fixAliasThis" "-preview=intpromote" "-preview=rvaluerefparam" "-preview=in"
/* dflags "-preview=inclusiveincontracts" platform="dmd" // only on dmd */
/* dflags "-preview=dip1021" platform="posix-ldc" // "breaks the build */
buildType "release-nobounds" {
buildOptions "releaseMode" "optimize" "inline" "noBoundsCheck"
# link time optimizations
dflags "--flto=full" "--ffast-math" platfrom="ldc"
}
buildType "debug-sanitize-address" platform="ldc" {
dflags "--fsanitize=address" "--link-defaultlib-debug"
buildOptions "debugMode" "debugInfo"
}
buildType "debug-sanitize-memory" platform="ldc" {
dflags "--fsanitize=memory" "--link-defaultlib-debug"
buildOptions "debugMode" "debugInfo"
}