summaryrefslogtreecommitdiff
path: root/build_and_test.sh
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-12-07 17:54:04 +0100
committerMitya Selivanov <automainint@guattari.tech>2023-12-07 17:54:04 +0100
commit820b171245f2f14766f3accdb0246a4e2c0d596a (patch)
tree9e2df3027dab99956371ea9ed86cd67ef81a9917 /build_and_test.sh
parentaa5c9be52f2d41b8efb240ad96f808cf4f3e79c1 (diff)
downloadsaw-820b171245f2f14766f3accdb0246a4e2c0d596a.zip
Refactor
Diffstat (limited to 'build_and_test.sh')
-rw-r--r--build_and_test.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/build_and_test.sh b/build_and_test.sh
index 0500c5f..ecab8e7 100644
--- a/build_and_test.sh
+++ b/build_and_test.sh
@@ -1,6 +1,11 @@
+#
+# General build instructions
+#
+
FOLDER=build_gcc
OS=Linux
COMPILE=gcc
+COMPILEPP=g++
OBJ_POSTFIX=.o
EXE_POSTFIX=
FLAGS=
@@ -11,18 +16,22 @@ LINK_FLAGS="-lm -lX11 -lXi -lXcursor -lGL"
if [ "$2" = "gcc" ]; then
FOLDER=build_gcc
COMPILE=gcc
+ COMPILEPP=g++
elif [ "$2" = "clang" ]; then
FOLDER=build_clang
COMPILE=clang
+ COMPILEPP=clang++
elif [ "$2" = "msvc" ]; then
FOLDER=build_msvc
COMPILE=cl.exe
+ COMPILEPP=cl.exe
OBJ_POSTFIX=.obj
FLAG_OBJ="-c -Fo"
FLAG_EXE="-Fe"
elif [ "$2" = "emcc" ]; then
FOLDER=build_emcc
COMPILE=emcc
+ COMPILEPP=em++
EXE_POSTFIX=.js
LINK_FLAGS="-sFULL_ES3=1"
elif [ "$2" != "" ]; then
@@ -51,6 +60,7 @@ if [ "$COMPILE" != "emcc" ]; then
if command -v clang >/dev/null 2>&1; then
echo "C compiler found - Clang"
COMPILE=clang
+ COMPILEPP=clang++
elif command -v gcc >/dev/null 2>&1; then
echo "C compiler found - GCC"
else
@@ -66,6 +76,7 @@ if [ "$COMPILE" != "emcc" ]; then
if command -v cl.exe >/dev/null 2>&1; then
echo "C compiler found - MSVC"
COMPILE=cl.exe
+ COMPILEPP=cl.exe
OBJ_POSTFIX=.obj
FLAG_OBJ="-c -Fo"
FLAG_EXE="-Fe"
@@ -74,6 +85,7 @@ if [ "$COMPILE" != "emcc" ]; then
elif command -v clang >/dev/null 2>&1; then
echo "C compiler found - Clang"
COMPILE=clang
+ COMPILEPP=clang++
else
echo "C compiler not found"
exit 1
@@ -92,6 +104,7 @@ if [ "$COMPILE" != "emcc" ]; then
elif command -v clang >/dev/null 2>&1; then
echo "C compiler found - Clang"
COMPILE=clang
+ COMPILEPP=clang++
else
echo "C compiler not found"
exit 1
@@ -125,6 +138,10 @@ fi
echo ""
+#
+# Project-specific instructions
+#
+
echo "Build saw"
if [ ! -f "$FOLDER/saw_impl${OBJ_POSTFIX}" ] || \
[ "source/saw/_impl.c" -nt "$FOLDER/saw_impl${OBJ_POSTFIX}" ]; then