aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorxyb <xyb@xyb.name>2020-09-05 10:45:48 -0700
committerGitHub <noreply@github.com>2020-09-05 10:45:48 -0700
commitfdac1fc5aa36e8edeb9f358f0fad041de2626215 (patch)
tree56cdf5ea8aa709b27b2ea8c989af3c0b3f000117 /scripts
parentbd8af0789804dad0f76dced3f837845f086350c5 (diff)
downloadvcpkg-fdac1fc5aa36e8edeb9f358f0fad041de2626215.tar.gz
vcpkg-fdac1fc5aa36e8edeb9f358f0fad041de2626215.zip
Add community triple arm64-linux and arm-linux. (#11880)
Verify the following command on both 32 bits and 64 bits OS on Raspberry pi 3. ./bootstrap-vcpkg.sh ./vcpkg install boost
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bootstrap.sh18
-rw-r--r--scripts/buildsystems/vcpkg.cmake4
-rw-r--r--scripts/cmake/vcpkg_configure_cmake.cmake2
3 files changed, 23 insertions, 1 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 321a16e05..46f695864 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -79,6 +79,16 @@ vcpkgCheckRepoTool()
fi
}
+vcpkgCheckBuildTool()
+{
+ __tool=$1
+ if ! command -v "$__tool" >/dev/null 2>&1 ; then
+ echo "Could not find $__tool. Please install it (and other dependencies) with:"
+ echo "sudo apt-get install cmake ninja-build"
+ exit 1
+ fi
+}
+
vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
@@ -226,10 +236,18 @@ selectCXX()
# Preparation
UNAME="$(uname)"
+ARCH="$(uname -m)"
+
+# Force using system utilities for building vcpkg if host arch is arm or arm64.
+if [ "$ARCH" = "armv7l" -o "$ARCH" = "aarch64" ]; then
+ vcpkgUseSystem=true
+fi
if $vcpkgUseSystem; then
cmakeExe="cmake"
ninjaExe="ninja"
+ vcpkgCheckBuildTool "$cmakeExe"
+ vcpkgCheckBuildTool "$ninjaExe"
else
fetchTool "cmake" "$UNAME" cmakeExe || exit 1
fetchTool "ninja" "$UNAME" ninjaExe || exit 1
diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake
index c1df616da..f2e89c5db 100644
--- a/scripts/buildsystems/vcpkg.cmake
+++ b/scripts/buildsystems/vcpkg.cmake
@@ -172,6 +172,10 @@ else()
set(_VCPKG_TARGET_TRIPLET_ARCH x64)
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "s390x")
set(_VCPKG_TARGET_TRIPLET_ARCH s390x)
+ elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "armv7l")
+ set(_VCPKG_TARGET_TRIPLET_ARCH arm)
+ elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "aarch64")
+ set(_VCPKG_TARGET_TRIPLET_ARCH arm64)
else()
if( _CMAKE_IN_TRY_COMPILE )
message(STATUS "Unable to determine target architecture, continuing without vcpkg.")
diff --git a/scripts/cmake/vcpkg_configure_cmake.cmake b/scripts/cmake/vcpkg_configure_cmake.cmake
index b443856f9..63d7f8786 100644
--- a/scripts/cmake/vcpkg_configure_cmake.cmake
+++ b/scripts/cmake/vcpkg_configure_cmake.cmake
@@ -150,7 +150,7 @@ function(vcpkg_configure_cmake)
endif()
# If we use Ninja, make sure it's on PATH
- if(GENERATOR STREQUAL "Ninja")
+ if(GENERATOR STREQUAL "Ninja" AND NOT DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES})
vcpkg_find_acquire_program(NINJA)
get_filename_component(NINJA_PATH ${NINJA} DIRECTORY)
vcpkg_add_to_path("${NINJA_PATH}")