Commit 58843c2a authored by Volker Hilsheimer's avatar Volker Hilsheimer

Allow overriding of compiler in build-qt job

Evaluate --cc and --cxx parameters, default to the highest installed
version of gcc or clang.
parent 10365d5b
......@@ -28,7 +28,7 @@ Supported job parameters:
Override the default build tree:
$minicoin run ubuntu1804 build-qt -- --build qt-build-5.15
$ minicoin run ubuntu1804 build-qt -- --build qt-build-5.15
......@@ -39,3 +39,10 @@ Supported job parameters:
Use qmake build system also if a cmake build system is present.
Ignored if the build is already configured with cmake, combine with
--clean or use a separate --build to switch build systems.
--cc path
--cxx path
Use the C and C++ compiler at the specified path, e.g.
$ minicoin run ubuntu1804 build-qt -- -cc /usr/bin/clang-10 --cxx /usr/bin/clang++10
......@@ -7,6 +7,23 @@ then
exit 1
# use highest installed version of gcc or clang, unless compilers are specified
function search_highest
[ -z $1 ] && return
local search_version=8
local highest_found=
while [[ -f "${1}-${search_version}" ]]
search_version=$(( $search_version + 1 ))
[ -z highest_found ] || echo ${1}-${highest_found}
export CC=${PARAM_cc:-$(search_highest "$(which gcc || which clang)")}
export CXX=${PARAM_cxx:-$(search_highest "$(which g++ || which clang++)")}
# set defaults
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment