-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·49 lines (34 loc) · 1.04 KB
/
build.sh
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
#/bin/bash
set -eu
script_path="$(realpath $0)"
root="$(dirname $script_path)"
pushd "$(dirname $0)"
compiler=${CC:-g++}
src_files=(
src/main.cxx
src/util/random.cxx
src/layout/layout_tree.cxx
src/rendering.cxx
src/rendering_context.cxx
)
rapidxml_version="1.13"
rapidxml_flags="-I$root/vendor/rapidxml-$rapidxml_version"
skia_include="$root/vendor/skia"
skia_link="-L$root/vendor/skia/out/Static -lskia"
skia_flags="$skia_link -I$skia_include -DSK_GL -DSK_GANESH"
glfw_flags=$(pkg-config --cflags --libs glfw3)
gl_flags=$(pkg-config --cflags --libs gl)
misc_lib_flags=$(pkg-config --cflags --libs libwebp libwebpmux libwebpdemux libpng libjpeg fontconfig)
common_opts="$rapidxml_flags $skia_flags $glfw_flags $gl_flags -I$root/src -Wall --std=c++20 -lz $misc_lib_flags"
debug_opts="--debug -g --optimize -DDEBUG $common_opts"
mkdir -p build
pushd build >> /dev/null
all_src=""
for p in "${src_files[@]}"; do
all_src+=" ../${p}"
done
compile="$compiler $all_src -o clef $debug_opts"
echo $compile
$compile
popd >> /dev/null
popd >> /dev/null