diff --git a/scripts/install-windows.sh b/scripts/install-windows-vcpkg.sh similarity index 96% rename from scripts/install-windows.sh rename to scripts/install-windows-vcpkg.sh index 328823d..4dce356 100644 --- a/scripts/install-windows.sh +++ b/scripts/install-windows-vcpkg.sh @@ -27,7 +27,7 @@ echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-windows.cmake echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x64-windows-static.cmake echo "set(VCPKG_BUILD_TYPE release)" >> triplets/x86-windows.cmake echo "set(VCPKG_BUILD_TYPE release)" >> triplets/community/x64-windows-static-md.cmake -export VCPKG_DEFAULT_TRIPLET=x64-windows +export VCPKG_DEFAULT_TRIPLET=x64-windows-static #./vcpkg install llvm # takes very long time ( set +e diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100644 index 0000000..ecf0631 --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -xeu + +ci_dir="$(dirname "$0")" + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + os_family="Linux" +elif [[ "$OSTYPE" == "darwin"* ]]; then + os_family="macOS" +elif [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then + os_family="Windows" +elif [[ "$OSTYPE" == "freebsd"* ]]; then + exit "FreeBSD is not supported" +else + exit "Unknown OS: $OSTYPE" +fi + +if [[ "$os_family" == "Linux" ]]; then + # free up disk space in Github Actions image: https://github.com/actions/runner-images/issues/2840 + sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost + if [[ "${VCPKG_VERSION:-}" != "" ]]; then # vcpkg build + "$ci_dir/install-ubuntu-vcpkg.sh" + else + "$ci_dir/install-ubuntu.sh" + fi +elif [[ "$os_family" == "macOS" ]]; then + if [[ "${BREW_OPENCV_VERSION:-}" != "" ]]; then # brew build + "$ci_dir/install-macos-brew.sh" + elif [[ "${VCPKG_VERSION:-}" != "" ]]; then # vcpkg build + "$ci_dir/install-macos-vcpkg.sh" + else + "$ci_dir/install-macos-framework.sh" + fi +elif [[ "$os_family" == "Windows" ]]; then + export CHOCO_LLVM_VERSION=18.1.8 + if [[ "${VCPKG_VERSION:-}" != "" ]]; then # vcpkg build + "$ci_dir/install-windows-vcpkg.sh" + else # chocolatey build + "$ci_dir/install-windows-chocolatey.sh" + fi +fi \ No newline at end of file