aboutsummaryrefslogtreecommitdiffstats
path: root/clean_build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'clean_build.sh')
-rwxr-xr-xclean_build.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/clean_build.sh b/clean_build.sh
new file mode 100755
index 0000000..3085c08
--- /dev/null
+++ b/clean_build.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+cd "$(dirname $0)" || exit 1
+# some environments have cmake v2 as 'cmake' and v3 as 'cmake3'
+# check for cmake3 first then fallback to just cmake
+B_CMAKE=`type cmake3 2>/dev/null`
+if [ $? -eq 0 ]; then
+ B_CMAKE=`echo $B_CMAKE | cut -d' ' -f3`
+else
+ B_CMAKE=cmake
+fi
+# default build configuration
+B_BUILD_TYPE=${B_BUILD_TYPE:-Debug}
+if [ "$(uname)" = "Darwin" ]; then
+ # OSX needs a lot of extra help, poor thing
+ # run the osx_environment.sh script to fix paths
+ . ./osx_environment.sh
+ B_CMAKE_FLAGS="-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 $B_CMAKE_FLAGS"
+fi
+# allow local customizations to build environment
+[ -r ./build_env.sh ] && . ./build_env.sh
+B_CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=$B_BUILD_TYPE $B_CMAKE_FLAGS"
+rm -rf build
+mkdir build || exit 1
+cd build || exit 1
+echo Starting Barrier $B_BUILD_TYPE build...
+$B_CMAKE $B_CMAKE_FLAGS .. || exit 1
+make || exit 1
+echo "Build completed successfully"