aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap.sh')
-rw-r--r--scripts/bootstrap.sh33
1 files changed, 8 insertions, 25 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index bf8de7897..7959c4465 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -199,11 +199,10 @@ fetchTool()
selectCXX()
{
- __output=$1
-
if [ "x$CXX" = "x" ]; then
- CXX=g++
- if which g++-9 >/dev/null 2>&1; then
+ if which g++ >/dev/null 2>&1; then
+ CXX=g++
+ elif which g++-9 >/dev/null 2>&1; then
CXX=g++-9
elif which g++-8 >/dev/null 2>&1; then
CXX=g++-8
@@ -212,24 +211,8 @@ selectCXX()
elif which g++-6 >/dev/null 2>&1; then
CXX=g++-6
fi
+ # If we can't find g++, allow CMake to do the look-up
fi
-
- gccversion="$("$CXX" -v 2>&1)"
- gccversion="$(extractStringBetweenDelimiters "$gccversion" "gcc version " ".")"
- if [ "$gccversion" -lt "6" ]; then
- echo "CXX ($CXX) is too old; please install a newer compiler such as g++-7."
- echo "On Ubuntu try the following:"
- echo " sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y"
- echo " sudo apt-get update -y"
- echo " sudo apt-get install g++-7 -y"
- echo "On CentOS try the following:"
- echo " sudo yum install centos-release-scl"
- echo " sudo yum install devtoolset-7"
- echo " scl enable devtoolset-7 bash"
- return 1
- fi
-
- eval $__output="'$CXX'"
}
# Preparation
@@ -246,10 +229,10 @@ if [ "$os" = "osx" ]; then
if [ "$vcpkgAllowAppleClang" = "true" ] ; then
CXX=clang++
else
- selectCXX CXX || exit 1
+ selectCXX
fi
else
- selectCXX CXX || exit 1
+ selectCXX
fi
# Do the build
@@ -257,8 +240,8 @@ buildDir="$vcpkgRootDir/toolsrc/build.rel"
rm -rf "$buildDir"
mkdir -p "$buildDir"
-(cd "$buildDir" && CXX=$CXX "$cmakeExe" .. -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=Off" "-DDEFINE_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
-(cd "$buildDir" && "$cmakeExe" --build .) || exit 1
+("$cmakeExe" -B "$buildDir" -S toolsrc -DCMAKE_BUILD_TYPE=Release -G "Ninja" "-DCMAKE_MAKE_PROGRAM=$ninjaExe" "-DBUILD_TESTING=OFF" "-DVCPKG_DEVELOPMENT_WARNINGS=OFF" "-DVCPKG_WARNINGS_AS_ERRORS=OFF" "-DVCPKG_DISABLE_METRICS=$vcpkgDisableMetrics" "-DVCPKG_ALLOW_APPLE_CLANG=$vcpkgAllowAppleClang") || exit 1
+("$cmakeExe" --build "$buildDir") || exit 1
rm -rf "$vcpkgRootDir/vcpkg"
cp "$buildDir/vcpkg" "$vcpkgRootDir/"