You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/04/11 14:31:19 UTC

[incubator-nuttx] 02/02: tools/testbuild.sh: add -e option to append extra c/c++ flags build support

This is an automated email from the ASF dual-hosted git repository.

gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2427febba9537f269430e27dde9101b4cbe0bb04
Author: liuhaitao <li...@xiaomi.com>
AuthorDate: Fri Apr 10 11:15:46 2020 +0800

    tools/testbuild.sh: add -e option to append extra c/c++ flags build support
    
    Call 'tools/testbuild.sh -e -Wno-cpp testlist' would pass "EXTRAFLAGS=-Wno-cpp"
    to make command line. Then it could suppress the warnings with pre-processor
    directive #warning in GCC.
    
    Change-Id: I61e5f9b3774149f64bdd625677cc9aabaa2fea90
    Signed-off-by: liuhaitao <li...@xiaomi.com>
---
 tools/testbuild.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/testbuild.sh b/tools/testbuild.sh
index fd901b6..9125f34 100755
--- a/tools/testbuild.sh
+++ b/tools/testbuild.sh
@@ -39,6 +39,7 @@ progname=$0
 fail=0
 APPSDIR=$WD/../apps
 MAKE_FLAGS=-k
+EXTRA_FLAGS=
 MAKE=make
 unset testfile
 unset HOPTION
@@ -48,13 +49,14 @@ GITCLEAN=0
 
 function showusage {
   echo ""
-  echo "USAGE: $progname [-l|m|c|u|g|n] [-d] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file>"
+  echo "USAGE: $progname [-l|m|c|u|g|n] [-d] [-e <extraflags>] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] <testlist-file>"
   echo "       $progname -h"
   echo ""
   echo "Where:"
   echo "  -l|m|c|u|g|n selects Linux (l), macOS (m), Cygwin (c),"
   echo "     Ubuntu under Windows 10 (u), MSYS/MSYS2 (g) or Windows native (n).  Default Linux"
   echo "  -d enables script debug output"
+  echo "  -e pass extra c/c++ flags such as -Wno-cpp via make command line"
   echo "  -x exit on build failures"
   echo "  -j <ncpus> passed on to make.  Default:  No -j make option."
   echo "  -a <appsdir> provides the relative path to the apps/ directory.  Default ../apps"
@@ -85,6 +87,10 @@ while [ ! -z "$1" ]; do
   -d )
     set -x
     ;;
+  -e )
+    shift
+    EXTRA_FLAGS="EXTRAFLAGS=$1"
+    ;;
   -x )
     MAKE_FLAGS='--silent --no-print-directory'
     set -e
@@ -214,7 +220,7 @@ function configure {
 function build {
   echo "  Building NuttX..."
   echo "------------------------------------------------------------------------------------"
-  makefunc ${JOPTION} ${MAKE_FLAGS} 1>/dev/null
+  makefunc ${JOPTION} ${MAKE_FLAGS} ${EXTRA_FLAGS} 1>/dev/null
 }
 
 # Coordinate the steps for the next build test