Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/cpp/.devcontainer/base-scripts/install-vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,17 @@ USERNAME=${1:-"vscode"}

. /etc/os-release

# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
# The buster pkg repo install cmake version < 3.15 which is required to run bootstrap-vcpkg.sh on ARM64
VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES="buster"

if [ "$(dpkg --print-architecture)" = "arm64" ]; then
echo "OS ${VERSION_CODENAME} ARM64 pkg repo installs cmake version < 3.15, which is required to build Vcpkg."
exit 0
# Exit early if ARM64 OS does not have cmake version required to build Vcpkg
if [[ "${VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
echo "OS ${VERSION_CODENAME} ARM64 pkg repo installs cmake version < 3.15, which is required to build Vcpkg."
exit 0
fi

export VCPKG_FORCE_SYSTEM_BINARIES=1
fi

# Add to bashrc/zshrc files for all users.
Expand Down Expand Up @@ -80,6 +87,13 @@ if [[ "\${PATH}" != *"\${VCPKG_ROOT}"* ]]; then export PATH="\${PATH}:\${VCPKG_R
EOF
)"

if [[ -n "$VCPKG_FORCE_SYSTEM_BINARIES" ]]; then
updaterc "$(cat << EOF
export VCPKG_FORCE_SYSTEM_BINARIES=1
EOF
)"
fi

# Give read/write permissions to the user group.
chown -R ":vcpkg" "${VCPKG_ROOT}" "${VCPKG_DOWNLOADS}"
chmod g+r+w+s "${VCPKG_ROOT}" "${VCPKG_DOWNLOADS}"
Expand Down
7 changes: 4 additions & 3 deletions src/cpp/test-project/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ source test-utils.sh vscode
checkCommon

# Help determine distro
. /etc/os-release
. /etc/os-release

checkOSPackages "command-line-tools" build-essential cmake cppcheck valgrind clang lldb llvm gdb
checkOSPackages "tools-for-vcpkg" tar curl zip unzip pkg-config bash-completion ninja-build
if [ "$(dpkg --print-architecture)" = "amd64" ] ; then
VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES="buster"
if [ "$(dpkg --print-architecture)" = "amd64" ] || [[ ! "${VCPKG_UNSUPPORTED_ARM64_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
check "VCPKG_ROOT" [ -d "${VCPKG_ROOT}" ]
check "VCPKG_DOWNLOAD" [ -d "${VCPKG_DOWNLOADS}" ]
VCPKG_FORCE_SYSTEM_BINARIES=1 check "vcpkg-from-root" ${VCPKG_ROOT}/vcpkg --version
VCPKG_FORCE_SYSTEM_BINARIES=1 check "vcpkg-from-bin" vcpkg --version
fi
fi
check "g++" g++ -g main.cpp -o main.out
rm main.out
mkdir -p build
Expand Down