summaryrefslogtreecommitdiff
path: root/build_and_test.sh
diff options
context:
space:
mode:
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