In order to configure, build, and run tests in a CentOS 8 (or similar)
container we need a functioning gcc-toolset compiler. This relies on
the environment script being sourced as well. cmake does not appear
to be able to discover this compiler own its own.
Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit
435d4c75386b0b58b33e3e2024983c608b46249c)
break
fi
done
+ # but if this is {centos,rhel} we need gcc-toolset
+ if [ -f "/opt/rh/gcc-toolset-11/enable" ]; then
+ ci_debug "Detected SCL gcc-toolset-11 environment file"
+ compiler_env="/opt/rh/gcc-toolset-11/enable"
+ # shellcheck disable=SC1090
+ cxx_compiler="$(. ${compiler_env} && command -v g++)"
+ # shellcheck disable=SC1090
+ c_compiler="$(. ${compiler_env} && command -v gcc)"
+ fi
export discovered_c_compiler="${c_compiler}"
export discovered_cxx_compiler="${cxx_compiler}"
if ! discover_compiler ci-build ; then
ci_debug "Failed to discover a compiler"
fi
+ if [ "${discovered_compiler_env}" ]; then
+ ci_debug "Enabling compiler environment file: ${discovered_compiler_env}"
+ . "${discovered_compiler_env}"
+ fi
local cxx_compiler="${discovered_cxx_compiler}"
local c_compiler="${discovered_c_compiler}"
local cmake_opts