Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
set clang to default compiler on ubuntu,amz2,macos
Browse files Browse the repository at this point in the history
also bump the minimum version of clang the script looks for to 6.0 (cmake check is left at 5.0 for now still, still that still technically compiles eosio okay)
  • Loading branch information
spoonincode committed Jun 20, 2019
1 parent cdfb2dc commit 49a596c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/helpers/eosio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,14 @@ function prompt-mongo-install() {
}

function ensure-compiler() {
export CXX=${CXX:-c++}
export CC=${CC:-cc}
DEFAULT_CXX=clang++
DEFAULT_CC=clang
if [[ $NAME == "CentOS Linux" ]]; then
DEFAULT_CXX=g++
DEFAULT_CC=gcc
fi
export CXX=${CXX:-$DEFAULT_CXX}
export CC=${CC:-$DEFAULT_CC}
if $PIN_COMPILER || [[ -f $CLANG_ROOT/bin/clang++ ]]; then
export PIN_COMPILER=true
export BUILD_CLANG=true
Expand All @@ -141,9 +147,9 @@ function ensure-compiler() {
[[ $( $(which $CXX) --version | cut -d ' ' -f 4 | cut -d '.' -f 1 | head -n 1 ) -lt 10 ]] && export NO_CPP17=true
else
if [[ $( $(which $CXX) --version | cut -d ' ' -f 3 | head -n 1 | cut -d '.' -f1) =~ ^[0-9]+$ ]]; then # Check if the version message cut returns an integer
[[ $( $(which $CXX) --version | cut -d ' ' -f 3 | head -n 1 | cut -d '.' -f1) < 5 ]] && export NO_CPP17=true
[[ $( $(which $CXX) --version | cut -d ' ' -f 3 | head -n 1 | cut -d '.' -f1) < 6 ]] && export NO_CPP17=true
elif [[ $(clang --version | cut -d ' ' -f 4 | head -n 1 | cut -d '.' -f1) =~ ^[0-9]+$ ]]; then # Check if the version message cut returns an integer
[[ $( $(which $CXX) --version | cut -d ' ' -f 4 | cut -d '.' -f 1 | head -n 1 ) < 5 ]] && export NO_CPP17=true
[[ $( $(which $CXX) --version | cut -d ' ' -f 4 | cut -d '.' -f 1 | head -n 1 ) < 6 ]] && export NO_CPP17=true
fi
fi
else
Expand Down

0 comments on commit 49a596c

Please sign in to comment.