aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap.sh')
-rw-r--r--scripts/bootstrap.sh37
1 files changed, 27 insertions, 10 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 5de0998c1..4bb428668 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -1,12 +1,23 @@
#!/bin/sh
vcpkgDisableMetrics="OFF"
+vcpkgUseSystem=false
for var in "$@"
do
- if [ "$var" = "-disableMetrics" ]; then
+ if [ "$var" = "-disableMetrics" -o "$var" = "--disableMetrics" ]; then
vcpkgDisableMetrics="ON"
+ elif [ "$var" = "-useSystemBinaries" -o "$var" = "--useSystemBinaries" ]; then
+ vcpkgUseSystem=true
+ elif [ "$var" = "-help" -o "$var" = "--help" ]; then
+ echo "Usage: ./bootstrap-vcpkg.sh [options]"
+ echo
+ echo "Options:"
+ echo " -help Display usage help"
+ echo " -disableMetrics Do not build metrics reporting into the executable"
+ echo " -useSystemBinaries Force use of the system utilities for building vcpkg"
+ exit 1
else
- echo "Unknown argument $var"
+ echo "Unknown argument $var. Use '-help' for help."
exit 1
fi
done
@@ -191,13 +202,13 @@ selectCXX()
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 " 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"
+ echo " sudo yum install centos-release-scl"
+ echo " sudo yum install devtoolset-7"
+ echo " scl enable devtoolset-7 bash"
return 1
fi
@@ -206,8 +217,14 @@ selectCXX()
# Preparation
UNAME="$(uname)"
-fetchTool "cmake" "$UNAME" cmakeExe || exit 1
-fetchTool "ninja" "$UNAME" ninjaExe || exit 1
+
+if $vcpkgUseSystem; then
+ cmakeExe="cmake"
+ ninjaExe="ninja"
+else
+ fetchTool "cmake" "$UNAME" cmakeExe || exit 1
+ fetchTool "ninja" "$UNAME" ninjaExe || exit 1
+fi
selectCXX CXX || exit 1
# Do the build