[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / automated-tests / build.sh
index 7e812e1..a56cd87 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 
-TEMP=`getopt -o r --long rebuild \
+TEMP=`getopt -o rn --long rebuild,no-gen \
      -n 'genmake' -- "$@"`
 
 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
@@ -10,10 +10,12 @@ if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
 eval set -- "$TEMP"
 
 opt_rebuild=false
+opt_generate=true
 
 while true ; do
     case "$1" in
         -r|--rebuild) opt_rebuild=true ; shift ;;
+        -n|--no-gen)  opt_generate=false ; shift ;;
         --) shift ; break ;;
         *) shift ;;   # Ignore
     esac
@@ -26,7 +28,17 @@ fi
 
 function build
 {
-    (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
+    if [ $opt_generate == true -o $opt_rebuild == false ] ; then
+        (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
+        if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
+    fi
+    BUILDSYSTEM="Unix Makefiles"
+    BUILDCMD=make
+    if [ -e ../build/tizen/build.ninja ] ; then
+        BUILDSYSTEM="Ninja"
+        BUILDCMD=ninja
+    fi
+    (cd build ; cmake .. -DMODULE=$1 -G "$BUILDSYSTEM" ; $BUILDCMD -j7 )
 }
 
 if [ -n "$1" ] ; then