File indexing completed on 2024-05-19 04:45:46

0001 #!/bin/bash -fxv
0002 # NOTE #!/bin/bash -fxv prints all executed commands.
0003 
0004 # SPDX-FileCopyrightText: Lukas Sommer <sommerluk@gmail.com>
0005 # SPDX-License-Identifier: BSD-2-Clause OR MIT
0006 
0007 
0008 
0009 
0010 
0011 # -e exits on error,
0012 # -u errors on undefined variables,
0013 # and -o (for option) pipefail exits on command pipe failures
0014 set -euo pipefail
0015 errorcount=0
0016 
0017 echo "Dynamic codecheck against Qt6 started."
0018 # The “.” command will execute the given script within the context of
0019 # the current script, which is necessary in order to preserve the
0020 # environment variables that are set by the given script.
0021 . scripts/export-environment.sh
0022 echo Number of available CPU threads: $PARALLEL_PROCESSES
0023 rm --recursive --force build
0024 mkdir --parents build
0025 cd build
0026 cmake \
0027     -DCMAKE_CXX_COMPILER=clazy \
0028     -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy \
0029         -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=FALSE \
0030     -DADDITIONAL_WARNINGS=ON \
0031     -DBUILD_WITH_QT6=ON \
0032     ..
0033 cmake --build . --parallel $PARALLEL_PROCESSES 2>../artifact_warnings_qt6.txt
0034 cmake --build . --target install --parallel $PARALLEL_PROCESSES
0035 cd ..
0036 rm --recursive --force buildexamples
0037 mkdir --parents buildexamples
0038 cd buildexamples
0039 cmake \
0040     -DCMAKE_CXX_COMPILER=clazy \
0041     -DCMAKE_CXX_CLANG_TIDY=/usr/bin/clang-tidy \
0042         -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=FALSE \
0043     -DADDITIONAL_WARNINGS=ON \
0044     -DBUILD_WITH_QT6=ON \
0045     ../examples
0046 cmake --build . --parallel $PARALLEL_PROCESSES 2>>../artifact_warnings_qt6.txt
0047 cd ..
0048 [ -s artifact_warnings_qt6.txt ] && ((errorcount++))
0049 echo "Dynamic codecheck against Qt6 finished."
0050 
0051 echo Terminating continuous integration with exit code $errorcount.
0052 # NOTE The exit code of the last command is available with $? in the shell.
0053 exit $errorcount