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 "Build with IPO/LTO 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_INTERPROCEDURAL_OPTIMIZATION=TRUE \
0028     -DBUILD_WITH_QT6=ON \
0029     ..
0030 cmake --build . --parallel $PARALLEL_PROCESSES 2>../artifact_warnings_ipo_lto.txt
0031 # It is necessary to install this, because otherwise the following
0032 # build of the “examples” will fail.
0033 cmake --build . --target install --parallel $PARALLEL_PROCESSES
0034 cd ..
0035 rm --recursive --force buildexamples
0036 mkdir --parents buildexamples
0037 cd buildexamples
0038 cmake \
0039     -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE \
0040     -DBUILD_WITH_QT6=ON \
0041     ../examples
0042 cmake --build . --parallel $PARALLEL_PROCESSES 2>>../artifact_warnings_ipo_lto.txt
0043 cd ..
0044 [ -s artifact_warnings_ipo_lto.txt ] && ((errorcount++))
0045 echo "Dynamic codecheck against Qt6 finished."
0046 
0047 echo Terminating continuous integration with exit code $errorcount.
0048 # NOTE The exit code of the last command is available with $? in the shell.
0049 exit $errorcount