-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-plz
executable file
·741 lines (640 loc) · 20.9 KB
/
build-plz
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
#!/bin/bash
colored() {
if [ -t 1 ]; then
local black='0;30' red='0;31' green='0;32' orange='0;33' \
blue='0;34' purple='0;35' cyan='0;36' lgray='0;37' \
dgray='1;30' lred='1;31' lgreen='1;32' yellow='1;33' \
lblue='1;34' lpurple='1;35' lcyan='1;36' white='1;37'
echo -en "\e[${!1}m$2\e[0m"
else
echo -n "$2"
fi
[ -z "$3" ] && echo
}
fail() {
colored red "$1" 1>&2
exit 1
}
progress() {
while kill -0 "$1" &>/dev/null; do
local tm="$(date +%S)"
case $((tm%3)) in
0)
colored "$2" "$3 . " ret
;;
1)
colored "$2" "$3 .. " ret
;;
2)
colored "$2" "$3 ..." ret
;;
esac
sleep 1
done
printf '\n'
}
mstime() {
echo $(($(date +%s%N)/1000000))
}
measure() {
local start_tm=$1
echo "scale=2; $(($(mstime) - start_tm))/1000" | bc -l
}
make_includes() {
local IFS=$'\n'
for include in ${1//;/$'\n'}; do
local arg="-I"
[ "${include%:*}" = "system" ] && arg="-isystem"
printf '%s ' "$arg \"${include##*:}\""
done
}
include_list() {
while [ ! -z "$1" ]; do
printf '%s;' "$1"
shift
done
}
is_commands_equal() {
local cmd="$1"
local path="$2"
[ "command=\"$cmd\"" == "$(grep 'command=' "$path" 2>/dev/null)" ]
return
}
build_static_lib() {
local name="$1"
local build_source="$2"
local builddir="$3"
local CXX_COMPILER="$4"
local debug="$5"
local flags="$6"
local libs="$7"
local includes="$8"
if [ ! -z "$TARGET" ] && [ "$TARGET" != "$name" ]; then
return
fi
local already_built=false
local depinfo=
[ -f "$(pwd)/$builddir/hpp_depinfo" ] && \
depinfo=$("$(pwd)/$builddir/hpp_depinfo" \
$(make_includes "$includes") \
--hash -C "$(pwd)/$builddir/.ezbld/$name-depinfo" \
"$(pwd)/$build_source") && \
already_built=true
local cmd="$(command -v "$CXX_COMPILER") -c -std=c++20 \
$([ "$debug" == true ] && echo "-O0 -g" || echo "-O2 -march=native") \
$flags \
-L '$(pwd)/$builddir/3rd/lib' \
-L '$(pwd)/$builddir/3rd/lib64' \
-L '$(pwd)/$builddir' \
-L '$(pwd)/$builddir/submodules/luacpp/3rd/lib64' \
-L '$(pwd)/$builddir/submodules/luacpp/3rd/lib' \
$(make_includes "$includes") \
'$(pwd)/$build_source' \
-o '$(pwd)/$builddir/$name.o' \
$libs"
cmd="$(echo "$cmd" | sed 's/ */ /g' | tr '\n' ' ')"
local cmd_path="$builddir/.ezbld/$name-command"
! is_commands_equal "$cmd" "$cmd_path" && already_built=false
if [ $already_built = true ]; then
colored lpurple "$name already built"
return 0
fi
local start_tm=$(mstime)
colored yellow "Building lib$name.a ... " n
eval $cmd || fail "Build failed"
ar rcs "$(pwd)/$builddir/lib$name.a" "$(pwd)/$builddir/$name.o" || fail "Build failed"
rm -f "$builddir/$name.o"
echo "$depinfo" > "$(pwd)/$builddir/.ezbld/$name-depinfo"
printf '%s\n%s\n' "source=\"$(pwd)/$build_source\"" "command=\"$cmd\"" > "$cmd_path"
colored lgreen "done! $(measure $start_tm)s"
}
build_executable() {
local name="$1"
local build_source="$2"
local builddir="$3"
local CXX_COMPILER="$4"
local debug="$5"
local flags="$6"
local libs="$7"
local includes="$8"
if [ ! -z "$TARGET" ] && [ "$TARGET" != "$name" ]; then
return 1
fi
local already_built=false
local depinfo=
[ -f "$(pwd)/$builddir/hpp_depinfo" ] && \
depinfo=$("$(pwd)/$builddir/hpp_depinfo" \
$(make_includes "$includes") \
--hash -C "$(pwd)/$builddir/.ezbld/$name-depinfo" \
"$(pwd)/$build_source") && \
already_built=true
# echo "$(pwd)/$builddir/hpp_depinfo" $(make_includes "$includes") "$(pwd)/$build_source"
# "$(pwd)/$builddir/hpp_depinfo" $(make_includes "$includes") "$(pwd)/$build_source"
# echo "HASH: $depinfo"
local cmd="$(command -v "$CXX_COMPILER") -std=c++20 \
$([ "$debug" == true ] && echo "-O0 -g" || echo "-O2 -march=native") \
$flags \
-L '$(pwd)/$builddir/3rd/lib' \
-L '$(pwd)/$builddir/3rd/lib64' \
-L '$(pwd)/$builddir' \
-L '$(pwd)/$builddir/submodules/luacpp/3rd/lib64' \
-L '$(pwd)/$builddir/submodules/luacpp/3rd/lib' \
$(make_includes "$includes") \
'$(pwd)/$build_source' \
-o '$(pwd)/$builddir/$name' \
$libs"
cmd="$(echo "$cmd" | sed 's/ */ /g' | tr '\n' ' ')"
local cmd_path="$builddir/.ezbld/$name-command"
! is_commands_equal "$cmd" "$cmd_path" && already_built=false
if [ $already_built = true ]; then
colored lpurple "$name already built"
return 1
fi
local start_tm=$(mstime)
colored yellow "Building $name ... " n
eval $cmd || fail "Build failed"
echo "$depinfo" > "$(pwd)/$builddir/.ezbld/$name-depinfo"
printf '%s\n%s\n' "source=\"$(pwd)/$build_source\"" "command=\"$cmd\"" > "$cmd_path"
colored lgreen "done! $(measure $start_tm)s"
return 0
}
codegen_step() {
local builddir="$1"
local CXX_COMPILER="$2"
local input_header="$3"
local generator_name="$4"
local generator_cpp="$5"
local output_header="$6"
local includes="$7"
if [ ! -z "$TARGET" ] && [ "$TARGET" != "$name" ]; then
return
fi
local cmd="$CXX_COMPILER -E -fdiagnostics-color=always \
$(make_includes "$includes") \
'$input_header' 2> '$(pwd)/$builddir/.ezbld/_temp_stderr' | '$builddir/$generator_name' \
> '$output_header'"
cmd="$(echo "$cmd" | sed 's/ */ /g' | tr '\n' ' ')"
[ -f "$(pwd)/$builddir/hpp_depinfo" ] && \
depinfo=$("$(pwd)/$builddir/hpp_depinfo" \
$(make_includes "$includes") \
--hash -C "$(pwd)/$builddir/.ezbld/codegen-$generator_name-depinfo" \
"$(pwd)/$input_header") && \
already_gen=true
build_executable \
"$generator_name" \
"$generator_cpp" \
"$builddir" \
"$CXX_COMPILER" \
"" \
"" \
"" \
"$includes" && \
already_gen=false
local cmd_path="$builddir/.ezbld/codegen-$generator_name-command"
! is_commands_equal "$cmd" "$cmd_path" && already_gen=false
if [ "$already_gen" = true ]; then
colored lpurple "$generator_name already generated"
return 0
fi
local start_tm=$(mstime)
colored yellow "Generating $output_header ... " n
eval $cmd || (cat "$(pwd)/$builddir/.ezbld/_temp_stderr"; fail "Generation of $output_header failed")
echo "$depinfo" > "$(pwd)/$builddir/.ezbld/codegen-$generator_name-depinfo"
printf '%s\n%s\n' "source=\"$input_header\"" "command=\"$cmd\"" > "$cmd_path"
colored lgreen "done! $(measure $start_tm)s"
}
make_pch() {
local location="$1"
local builddir="$2"
local CXX_COMPILER="$3"
local debug="$4"
local flags="$5"
local includes="$6"
local name="${location##*/}"
name="${name%%.*}"
local output_dir="$builddir/gch"
local output="$output_dir/${location##*/}.gch"
local already_built=false
local depinfo=
[ -f "$(pwd)/$builddir/hpp_depinfo" ] && \
depinfo=$("$(pwd)/$builddir/hpp_depinfo" \
$(make_includes "$includes") \
--hash -C "$(pwd)/$builddir/.ezbld/pch-$name-depinfo" \
"$(pwd)/$location") && \
already_built=true
local cmd="$(command -v "$CXX_COMPILER") -std=c++20 -c \
$([ "$debug" == true ] && echo "-O0 -g" || echo "-O2 -march=native") \
$flags \
-L '$(pwd)/$builddir/3rd/lib' \
-L '$(pwd)/$builddir/3rd/lib64' \
-L '$(pwd)/$builddir' \
-L '$(pwd)/$builddir/submodules/luacpp/3rd/lib64' \
-L '$(pwd)/$builddir/submodules/luacpp/3rd/lib' \
$(make_includes "$includes") \
'$(pwd)/$location' \
-o '$output'"
cmd="$(echo "$cmd" | sed 's/ */ /g' | tr '\n' ' ')"
local cmd_path="$builddir/.ezbld/pch-$name-command"
! is_commands_equal "$cmd" "$cmd_path" && already_built=false
if [ $already_built = true ]; then
colored lpurple "pch $name already built"
return 0
fi
local start_tm=$(mstime)
colored yellow "Making precompiled header $location ... " n
mkdir -p "$output_dir"
eval $cmd || fail " Failed"
echo "$depinfo" > "$(pwd)/$builddir/.ezbld/pch-$name-depinfo"
printf '%s\n%s\n' "source=\"$location\"" "command=\"$cmd\"" > "$cmd_path"
colored lgreen "done! $(measure $start_tm)s"
}
build_cmake_submodule() {
local builddir="$1"; shift
local rebuild_submodules="$1"; shift
local submodule="$1"; shift
mkdir -p "$builddir/submodules/$submodule"
if [ ! -f "$builddir/submodules/$submodule/.easybuild_done" ] || [ "$rebuild_submodules" == true ]; then
git submodule init "submodules/$submodule" || fail
git submodule update --init --recursive "submodules/$submodule" || fail
rm -f "$builddir/submodules/$submodule/.easybuild_done"
cmake "submodules/$submodule/" -B "$builddir/submodules/$submodule" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER="$C_COMPILER" \
-DCMAKE_CXX_COMPILER="$CXX_COMPILER" \
-DCMAKE_INSTALL_PREFIX="$builddir/3rd" \
"$@" \
|| fail "CMake failed in submodule $submodule"
make -j "$(nproc)" -C "$builddir/submodules/$submodule" install \
|| fail "$submodule submodule build failed"
touch "$builddir/submodules/$submodule/.easybuild_done"
fi
}
install_headers() {
mkdir -p "$builddir/3rd"
cp "$@" "$builddir/3rd/"
}
take_greater_gcc_version() {
for i in $(find "$1" -path "*/$2"); do
printf '%s' "$i "
echo "$i" | tr -dc '0-9'
echo ""
done | sort -k2 -n -r | head -n1 | cut -d " " -f1
}
altlinux_fix_compodb() {
local curdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
local include_name
for include_name in 'iostream' 'bits/c++config.h'; do
local ipath="$(take_greater_gcc_version '/usr/include' "$include_name")"
ipath="${ipath%/$include_name}"
echo "APPEND PATH: $ipath"
sed -i "s|\"command\":[ \t]\+\"[a-zA-Z0-9+-/]\+|& -isystem $ipath|g" "$curdir/compile_commands.json"
done
}
gen_compodb() {
local builddir="$1"
local specific_file="$2"
echo "[" > ./compile_commands.json
local targets="$(ls $builddir/.ezbld/*-command)"
local count=
[ -z "$specific_file" ] && count=$(echo "$targets" | wc -w) || count=1
local idx=0
for f in $targets; do
local source=
local command=
. "$f"
if [ ! -z "$specific_file" ] && [ "$specific_file" != "${source##*/}" ]; then
continue
fi
idx=$((idx+1))
local end_seq="},"
[ $idx = $count ] && end_seq="}"
cat >> ./compile_commands.json <<EOF
{
"directory": "$(pwd)/$builddir",
"command": "$command",
"file": "$source"
$end_seq
EOF
done
echo "]" >> ./compile_commands.json
eval $(. /etc/os-release; echo local os_name="$NAME";)
[ "$os_name" = 'ALT' ] && altlinux_fix_compodb
}
asan_flags() {
cat <<EOF
-fsanitize=address
-fno-omit-frame-pointer
EOF
}
_print_help() {
cat << EOF
build-plz - bash mess to build this game
Generic options:
--builddir=DIR - specify build dir ('easybuild' by default)
--compodb - generate compile_commands.json for all targets/cpp_files
=FILE.cpp - generate compile_commands.json for specific target/cpp_file
--rebuild-subs - trigger submodules rebuild
--debug - enable debug build
--asab - enable ASAN build
--run NAME - run specific executable after build
--gdbrun NAME - run specific executable under gdb after build
--help - prints this help message
Environment variables:
C_COMPILER - overrides C compiler
CXX_COMPILER - overrides C++ compiler
Other options:
--gcc-versions - print available GCC (g++) versions on this machine
--used-compilers - print used compilers
EOF
}
take_greater_version() {
for path in $(ls "$1"*); do
local postfix="${path#$1}"
[[ "$postfix" =~ ^[0-9.]+$ ]] && echo "$path $postfix"
done | sort -t2 -k2 -n -r | head -n1 | cut -d " " -f1
}
_build() {
local CXX_COMPILER="${CXX_COMPILER:=$(take_greater_version '/usr/bin/g++-')}"
local C_COMPILER="${C_COMPILER:=$(take_greater_version '/usr/bin/gcc-')}"
local builddir='./easybuild'
local rebuild_submodules=false
local compodb=false
local compodb_source=
local debug=false
local asan=false
local android_abi=
local android_platform=
local android_ndk=
local run_args=
while [ -n "$1" ]; do
case "$1" in
--builddir=*)
builddir="${1#*=}"
[ "$debug" = true ] && builddir="$builddir-debug"
[ "$asan" = true ] && builddir="$builddir-asan"
;;
--rebuild-subs)
rebuild_submodules=true
;;
--compodb=*)
compodb=true
compodb_source="${1#*=}"
;;
--compodb)
compodb=true
;;
--debug)
debug=true
builddir="$builddir-debug"
;;
--asan)
asan=true
builddir="$builddir-asan"
;;
--run)
shift
run_args="LD_LIBRARY_PATH='$builddir/3rd/lib:$builddir/3rd/lib64' $builddir/$@"
break
;;
--gdbrun)
shift
run_args="LD_LIBRARY_PATH='$builddir/3rd/lib:$builddir/3rd/lib64' gdb --args $builddir/$@"
break
;;
--android)
android_abi=arm64-v8a
android_platform=29
android_ndk="$HOME/android-ndk-r23-beta6"
[[ ! $builddir =~ *-android ]] && builddir="$builddir-android"
;;
--android-abi=*)
android_abi="${1#*=}"
[[ ! $builddir =~ *-android ]] && builddir="$builddir-android"
;;
--android-platform=*)
android_platform="${1#*=}"
[[ ! $builddir =~ *-android ]] && builddir="$builddir-android"
;;
--android-ndk=*)
android_ndk="${1#*=}"
[[ ! $builddir =~ *-android ]] && builddir="$builddir-android"
;;
--gcc-versions)
for p in $(ls /usr/bin/g++-*); do
local name=$(basename "$p")
local ver="${name##*-}"
echo "${ver%%.*}"
done
exit 0
;;
--used-compilers)
echo "C_COMPILER='$C_COMPILER'"
echo "CXX_COMPILER='$CXX_COMPILER'"
exit 0
;;
--help)
_print_help
exit 0
;;
--*)
fail "Invalid option: $1"
;;
*)
TARGET+="$1"
#fail "Unknown argument $1"
;;
esac
shift
done
local hardening_flags="
-fstrict-aliasing
-Wall
-Wextra
-Wpedantic
-Wcast-align
-Wconversion
-Wctor-dtor-privacy
-Wextra-semi
-Wfloat-equal
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wredundant-decls
-Wsign-conversion
-Wsign-promo
-Werror=unused-result
-Wno-unused-function
-Wno-missing-braces
$([ "$asan" == true ] && asan_flags)
"
mkdir -p "$builddir/3rd"
mkdir -p "$builddir/.ezbld"
build_cmake_submodule "$builddir" $rebuild_submodules SFML
build_cmake_submodule "$builddir" $rebuild_submodules Catch2 -DCATCH_INSTALL_DOCS=OFF
build_cmake_submodule "$builddir" $rebuild_submodules luacpp -DENABLE_TESTS=ON
if [ ! -f "$builddir/submodules/boost/.easybuild_done" ] || [ "$rebuild_submodules" == true ]; then
git submodule init submodules/boost || fail
git submodule update --init --recursive submodules/boost || fail
mkdir -p "$builddir/submodules/boost"
rm -rf "$builddir/submodules/boost/*"
pushd 'submodules/boost' &> /dev/null
local variant=
[ $debug = true ] && variant=debug || variant=release
if [ ! -f ./b2 ]; then
./bootstrap.sh || fail
fi
sed -i "s|using gcc .*|using gcc : : $(basename "$CXX_COMPILER") ;|g" ./project-config.jam
./b2 \
variant=$variant \
link=static \
--with-fiber \
--with-coroutine \
install \
--no-cmake-config \
--prefix="../../$builddir/3rd/" \
|| fail
popd &> /dev/null
touch "$builddir/submodules/boost/.easybuild_done"
fi
if [ ! -f "$builddir/3rd/include/nuklear.h" ]; then
git submodule init submodules/Nuklear || fail ""
git submodule update submodules/Nuklear || fail ""
cp 'submodules/Nuklear/nuklear.h' "$builddir/3rd/include/"
fi
build_executable \
hpp_depinfo \
tools/hpp_depinfo.cpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"" \
"$(include_list \
"$(pwd)/src" \
)"
make_pch \
src/stdafx.hpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"$(include_list \
"system:$(pwd)/$builddir/submodules/luacpp/3rd/include/luajit-2.1" \
"system:$(pwd)/$builddir/3rd/include" \
"$(pwd)/src" \
)"
build_static_lib \
nuklear \
src/ui/nuklear.cpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"-lsfml-system -lsfml-window -lsfml-graphics -lGL -lGLEW" \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
)"
codegen_step \
"$builddir" \
"$CXX_COMPILER" \
src/net_actions.hpp \
net_actions_generator \
src/net_actions_generator.cpp \
src/net_actions_generated.hpp \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
)"
codegen_step \
"$builddir" \
"$CXX_COMPILER" \
"$builddir/3rd/include/SFML/Window/Keyboard.hpp" \
sfml_key_generator \
src/key_generator.cpp \
src/key_generated.hpp \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
)"
codegen_step \
"$builddir" \
"$CXX_COMPILER" \
"$builddir/3rd/include/SFML/Window/Event.hpp" \
sfml_event_type_generator \
src/event_type_generator.cpp \
src/event_type_generated.hpp \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
)"
build_executable \
dfdh \
diefastdiehard.cpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"-lboost_context -lboost_fiber -lnuklear -lsfml-system -lsfml-window -lsfml-graphics -lsfml-network -lsfml-audio -lpthread -lGL -lGLEW -lluajit-5.1" \
"$(include_list \
"$builddir/gch" \
"system:$(pwd)/$builddir/submodules/luacpp/3rd/include/luajit-2.1" \
"system:$(pwd)/$builddir/3rd/include" \
"$(pwd)/src" \
)"
build_executable \
cfg_test \
tests/cfg_test.cpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"-lboost_context -lboost_fiber -lpthread -lCatch2Main -lCatch2" \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
"$(pwd)/src" \
)"
build_executable \
net_tests \
tests/net_tests.cpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"-lboost_context -lboost_fiber -lpthread -lCatch2Main -lCatch2" \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
"$(pwd)/src" \
)"
# build_executable \
# fiber_test \
# tests/fiber_test.cpp \
# "$builddir" \
# "$CXX_COMPILER" \
# "$debug" \
# "$hardening_flags" \
# "-lpthread" \
# "$(include_list \
# "system:$(pwd)/$builddir/3rd/include" \
# "$(pwd)/src" \
# )"
build_executable \
tasks_test \
tests/tasks.cpp \
"$builddir" \
"$CXX_COMPILER" \
"$debug" \
"$hardening_flags" \
"-lpthread -lCatch2Main -lCatch2" \
"$(include_list \
"system:$(pwd)/$builddir/3rd/include" \
"$(pwd)/src" \
)"
# build_executable \
# gui-test \
# gui_test.cpp \
# "$builddir" \
# "$CXX_COMPILER" \
# "$debug" \
# "$hardening_flags" \
# "-lnuklear -lsfml-system -lsfml-window -lsfml-graphics -lGL -lGLEW"
[ "$compodb" = true ] && gen_compodb "$builddir" "$compodb_source"
eval $run_args
}
_build "$@"