File indexing completed on 2024-05-12 04:44:28

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 "QCH build 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_qch
0024 mkdir --parents build_qch
0025 cd build_qch
0026 # NOTE -DQHelpGenerator_EXECUTABLE=/usr/lib/qt5/bin/qhelpgenerator seems to be
0027 # necessary to find qhelpgenerator on the Gitlab CI system and other
0028 # systems where “if (TARGET Qt5::qhelpgenerator)” is not available.
0029 cmake -DBUILD_WITH_QT6=ON -DBUILD_QCH=ON -DQHelpGenerator_EXECUTABLE=/usr/lib/qt5/bin/qhelpgenerator -D_qmake_executable_default=/usr/lib/qt5/bin/qmake ..
0030 export XDG_RUNTIME_DIR="/tmp/runtime-root"
0031 cmake --build . --target perceptualcolor-0_QCH --parallel $PARALLEL_PROCESSES 2>../artifact_warnings_qch.txt
0032 # Also make an installation to test if everything works fine. Unfortunately,
0033 # this triggers a complete build of the whole project, but this seems
0034 # unavoidable.
0035 cmake --build . --target install --parallel $PARALLEL_PROCESSES
0036 cd ..
0037 [ -s artifact_warnings_qch.txt ] && ((errorcount++))
0038 echo "QCH build finished."
0039 
0040 echo Terminating continuous integration with exit code $errorcount.
0041 # NOTE The exit code of the last command is available with $? in the shell.
0042 exit $errorcount