Switched to a more robust way of detecting the current compiler.

This commit is contained in:
Marcel Pi 2022-04-26 15:24:17 +02:00 committed by bernat
parent 9aa4866bf1
commit 74e0c680cd
4 changed files with 27 additions and 7 deletions

View File

@ -78,7 +78,13 @@ fi
# ==============================================================================
ADRSS_INSTALL_DIR="${CARLA_BUILD_FOLDER}/${ADRSS_BASENAME}/install"
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang -dumpversion)")
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang --version | head -n 1 | grep -o -E "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+")")
if [ -z "$CARLA_LLVM_VERSION_MAJOR" ] ; then
fatal_error "Failed to retrieve the installed version of the clang compiler."
else
echo "Using clang-$CARLA_LLVM_VERSION_MAJOR as the CARLA compiler."
fi
#
# Since it it not possible with boost-python to build more than one python version at once (find_package has some bugs)

View File

@ -89,12 +89,14 @@ if ${BUILD_OSM2ODR} ; then
mkdir -p ${OSM2ODR_BUILD_FOLDER}
cd ${OSM2ODR_BUILD_FOLDER}
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang -dumpversion)")
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang --version | head -n 1 | grep -o -E "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+")")
if [[ -z "${CARLA_LLVM_VERSION_MAJOR}" ]]; then
fatal_error "Missing clang version variable."
if [ -z "$CARLA_LLVM_VERSION_MAJOR" ] ; then
fatal_error "Failed to retrieve the installed version of the clang compiler."
else
echo "Using clang-$CARLA_LLVM_VERSION_MAJOR as the CARLA compiler."
fi
export CC=/usr/bin/clang-$CARLA_LLVM_VERSION_MAJOR
export CXX=/usr/bin/clang++-$CARLA_LLVM_VERSION_MAJOR

View File

@ -48,7 +48,13 @@ while [[ $# -gt 0 ]]; do
esac
done
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang -dumpversion)")
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang --version | head -n 1 | grep -o -E "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+")")
if [ -z "$CARLA_LLVM_VERSION_MAJOR" ] ; then
fatal_error "Failed to retrieve the installed version of the clang compiler."
else
echo "Using clang-$CARLA_LLVM_VERSION_MAJOR as the CARLA compiler."
fi
source $(dirname "$0")/Environment.sh

View File

@ -37,7 +37,13 @@ done
# -- Set up environment --------------------------------------------------------
# ==============================================================================
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang -dumpversion)")
CARLA_LLVM_VERSION_MAJOR=$(cut -d'.' -f1 <<<"$(clang --version | head -n 1 | grep -o -E "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+")")
if [ -z "$CARLA_LLVM_VERSION_MAJOR" ] ; then
fatal_error "Failed to retrieve the installed version of the clang compiler."
else
echo "Using clang-$CARLA_LLVM_VERSION_MAJOR as the CARLA compiler."
fi
source $(dirname "$0")/Environment.sh