Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[jenkins] Fix optimization variable name
[simgrid.git] / buildtools / jenkins / build.sh
index eb87979..b0ac127 100755 (executable)
@@ -2,10 +2,23 @@
 
 set -e
 
-echo "Running $0 with arguments:" >&2
-for arg in "$@"; do
-  echo "- $arg"
-done
+# usage: die status message...
+die () {
+  local status=${1:-1}
+  shift
+  [ $# -gt 0 ] || set -- "Error - Halting"
+  echo "$@" >&2
+  exit $status
+}
+
+# Get an ON/OFF string from a command:
+onoff() {
+  if "$@" > /dev/null ; then
+    echo ON
+  else
+    echo OFF
+  fi
+}
 
 build_mode="$1"
 echo "Build mode $build_mode on $(uname -np)" >&2
@@ -20,13 +33,7 @@ case "$build_mode" in
   ;;
 
   *)
-    if test "$(uname -o)" = "Msys"; then
-      echo "On Windows, jenkins is not willing to expand variables for some reason" >&2
-      echo "Force use Debug mode" >&2
-    else
-      echo "Unknown build_mode $build_mode"
-      exit 1
-    fi
+    die 1 "Unknown build_mode $build_mode"
   ;;
 esac
 
@@ -40,24 +47,6 @@ else
   GENERATOR="Unix Makefiles"
 fi
 
-# usage: die status message...
-die () {
-  local status=${1:-1}
-  shift
-  [ $# -gt 0 ] || set -- "Error - Halting"
-  echo "$@" >&2
-  exit $status
-}
-
-# Get an ON/OFF string from a command:
-onoff() {
-  if "$@" > /dev/null ; then
-    echo ON
-  else
-    echo OFF
-  fi
-}
-
 ulimit -c 0 || true
 
 if [ -d $WORKSPACE/build ]
@@ -75,7 +64,7 @@ cd `cat VERSION`
 cmake -G"$GENERATOR"\
   -Denable_debug=ON -Denable_documentation=OFF -Denable_coverage=OFF \
   -Denable_model-checking=$(onoff test "$build_mode" = "ModelChecker") \
-  -Denable_compile_optimization=$(onoff test "$build_mode" = "Debug") \
+  -Denable_compile_optimizations=$(onoff test "$build_mode" = "Debug") \
   -Denable_smpi_MPICH3_testsuite=$(onoff test "$build_mode" != "DynamicAnalysis") \
   -Denable_lua=$(onoff test "$build_mode" != "DynamicAnalysis") \
   -Denable_mallocators=$(onoff test "$build_mode" != "DynamicAnalysis") \