Browse Source

add --debug parameter to build script

Jens Keim 5 years ago
parent
commit
92d68f7855
1 changed files with 6 additions and 2 deletions
  1. 6 2
      build.sh

+ 6 - 2
build.sh

@@ -2,6 +2,7 @@
 
 FULLBUILD=false
 NONINTERACTIVE=false
+BUILD_TYPE='Release'
 
 while test $# -gt 0
 do
@@ -12,6 +13,9 @@ do
         --full)
             FULLBUILD=true
             ;;
+        --debug)
+            BUILD_TYPE='Debug'
+            ;;
     esac
     shift
 done
@@ -57,7 +61,7 @@ fi
 
 which ninja &>/dev/null
 if [ $? != 0 ]; then
-    cmake ..
+    cmake -D CMAKE_BUILD_TYPE=${BUILD_TYPE} ..
 
     # Make sure we're able to get the number of cores
     if [ $(uname) = 'Darwin' ]; then
@@ -73,7 +77,7 @@ if [ $? != 0 ]; then
         exit
     fi
 else
-    cmake .. -G Ninja
+    cmake -D CMAKE_BUILD_TYPE=${BUILD_TYPE} .. -G Ninja
 
     if [ -f build.ninja ]; then
         ninja