tools/testbuild.sh: add option -N use CMake with Ninja

tools/testbuild.sh
     added option -N Use CMake with Ninja as the backend.

    updated help.

    added date to print startup board

   added HOST=Msys

github/workflows/build.yml

   added option -N job docker
This commit is contained in:
simbit18
2024-07-16 18:07:08 +02:00
committed by Xiang Xiao
parent bdf60d7966
commit 1540dc2d67
2 changed files with 24 additions and 14 deletions

View File

@@ -37,6 +37,7 @@ GITCLEAN=0
SAVEARTIFACTS=0
CHECKCLEAN=1
CODECHECKER=0
NINJACMAKE=0
RUN=0
case $(uname -s) in
@@ -49,6 +50,9 @@ case $(uname -s) in
MINGW32*)
HOST=MinGw
;;
MSYS*)
HOST=Msys
;;
*)
# Assume linux as a fallback
@@ -58,10 +62,11 @@ esac
function showusage {
echo ""
echo "USAGE: $progname [-l|m|c|g|n] [-d] [-e <extraflags>] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p] [-G] [--codechecker] <testlist-file>"
echo " $progname -h"
echo "USAGE: $progname -h [-l|m|c|g|n] [-d] [-e <extraflags>] [-x] [-j <ncpus>] [-a <appsdir>] [-t <topdir>] [-p]"
echo " [-A] [-C] [-G] [-N] [-R] [--codechecker] <testlist-file>"
echo ""
echo "Where:"
echo " -h will show this help test and terminate"
echo " -l|m|c|g|n selects Linux (l), macOS (m), Cygwin (c),"
echo " MSYS/MSYS2 (g) or Windows native (n). Default Linux"
echo " -d enables script debug output"
@@ -79,8 +84,8 @@ function showusage {
echo " * This assumes that only nuttx and apps repos need to be cleaned."
echo " * If the tree has files not managed by git, they will be removed"
echo " as well."
echo " -N Use CMake with Ninja as the backend."
echo " -R execute \"run\" script in the config directories if exists."
echo " -h will show this help test and terminate"
echo " --codechecker enables CodeChecker statically analyze the code."
echo " <testlist-file> selects the list of configurations to test. No default"
echo ""
@@ -132,6 +137,9 @@ while [ ! -z "$1" ]; do
-C )
CHECKCLEAN=0
;;
-N )
NINJACMAKE=1
;;
-R )
RUN=1
;;
@@ -180,7 +188,7 @@ export APPSDIR
testlist=`grep -v -E "^(-|#)|^[C|c][M|m][A|a][K|k][E|e]" $testfile || true`
blacklist=`grep "^-" $testfile || true`
if [ "X$HOST" == "XLinux" ]; then
if [ ${NINJACMAKE} -eq 1 ]; then
cmakelist=`grep "^[C|c][M|m][A|a][K|k][E|e]" $testfile | cut -d',' -f2 || true`
fi
@@ -277,7 +285,7 @@ function distclean {
makefunc distclean
# Remove .version manually because this file is shipped with
# the release package and then distclean has to keep it
# the release package and then distclean has to keep it.
rm -f .version
@@ -495,12 +503,14 @@ function dotest {
done
unset cmake
for l in $cmakelist; do
if [[ "${config/\//:}" == "${l}" ]]; then
echo "Cmake in present: $1"
cmake=1
fi
done
if [ ${NINJACMAKE} -eq 1 ]; then
for l in $cmakelist; do
if [[ "${config/\//:}" == "${l}" ]]; then
echo "Cmake in present: $1"
cmake=1
fi
done
fi
echo "Configuration/Tool: $1"
if [ ${PRINTLISTONLY} -eq 1 ]; then
@@ -538,7 +548,7 @@ function dotest {
fi
# Perform the build test
echo $(date '+%Y-%m-%d %H:%M:%S')
echo "------------------------------------------------------------------------------------"
distclean
configure