-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ninja
68 lines (56 loc) · 2.61 KB
/
build.ninja
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
# This has been written for windows. To build for linux or
# macos, you'll have to link to the libraries that sokol_app.h needs. Read the
# documentation there.
cxx = clang
builddir = build
warnings = -Wall -Werror -Wno-unused-command-line-argument -Wdouble-promotion -Wimplicit-int-float-conversion -Wstrict-prototypes
cflags = -Ietterna -Ilib -D_CRT_SECURE_NO_WARNINGS -fno-strict-aliasing -fvisibility=hidden -funsigned-char -fuse-ld=lld -g
cppflags = $cflags -fno-rtti -fno-exceptions -std=c++17 -Wno-missing-braces
sqliteflags = -DSQLITE_ENABLE_DESERIALIZE -DSQLITE_THREADSAFE=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_MAX_EXPR_DEPTH=0 -DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_SHARED_CACHE -DSQLITE_USE_ALLOCA -DSQLITE_DQS=0 -DSQLITE_MAX_EXPR_DEPTH=0
rule obj
deps = gcc
depfile = $out.d
command = $cxx -MD -MF $out.d $cflags -o $out -c $in
rule bin
deps = gcc
depfile = $out.d
command = $cxx -MD -MF $out.d $cflags -o $out $in
#
# Debug build. This compiles the calc with optimisations on as the assumption is
# you won't be debugging the calc. The visualization and optimization mostly waits
# around for calc results, so this is pretty usable.
build $builddir/debug/sqlite3.o: obj lib/sqlite3.c
description = $cxx sqlite3
cflags = -DDEBUG $sqliteflags -O2 $cflags
warnings = -w
build $builddir/debug/cpp.o: obj src/cpp.cpp
description = $cxx cpp.cpp
cflags = -DDEBUG -O2 $cppflags
cxx = clang++
build $builddir/debug/cminacalc.o: obj src/cminacalc.cpp
description = $cxx cminacalc.cpp
cflags = -DDEBUG -O2 $cppflags
cxx = clang++
build $builddir/debug/seeminacalc.exe: bin src/seeminacalc.c $builddir/debug/sqlite3.o $builddir/debug/cpp.o $builddir/debug/cminacalc.o
description = $cxx seeminacalc.c
cflags = -DDEBUG $warnings $cflags
#
# Native release build.
build $builddir/release/sqlite3.o: obj lib/sqlite3.c
description = $cxx sqlite3
cflags = -O2 -flto $cflags
warnings = -w
build $builddir/release/cpp.o: obj src/cpp.cpp
description = $cxx cpp.cpp
cflags = -O2 -flto $cppflags
cxx = clang++
build $builddir/release/cminacalc.o: obj src/cminacalc.cpp
description = $cxx cminacalc.cpp
cflags = -O2 -flto $cppflags
cxx = clang++
build $builddir/release/seeminacalc.exe: bin src/seeminacalc.c $builddir/release/sqlite3.o $builddir/release/cpp.o $builddir/release/cminacalc.o
description = $cxx seeminacalc.c
cflags = -O2 $cflags
default $builddir/debug/seeminacalc.exe
build debug: phony $builddir/debug/seeminacalc.exe
build release: phony $builddir/release/seeminacalc.exe