diff options
author | John Mulligan <jmulligan@redhat.com> | 2022-11-01 19:58:16 +0100 |
---|---|---|
committer | John Mulligan <jmulligan@redhat.com> | 2023-02-07 20:17:10 +0100 |
commit | 435d4c75386b0b58b33e3e2024983c608b46249c (patch) | |
tree | e4c5c1dea71d58d8189b931af0fd01c5584b7445 /src/script/lib-build.sh | |
parent | script: add discover_compiler function to lib-build.sh (diff) | |
download | ceph-435d4c75386b0b58b33e3e2024983c608b46249c.tar.xz ceph-435d4c75386b0b58b33e3e2024983c608b46249c.zip |
script: add gcc-toolset-11 support to discover_compiler
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>
Diffstat (limited to 'src/script/lib-build.sh')
-rw-r--r-- | src/script/lib-build.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/script/lib-build.sh b/src/script/lib-build.sh index c6ce94b633a..6c445534437 100644 --- a/src/script/lib-build.sh +++ b/src/script/lib-build.sh @@ -71,6 +71,15 @@ function discover_compiler() { 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}" |