mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 23:29:52 +00:00
Some checks are pending
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
46 lines
1.7 KiB
Bash
Executable file
46 lines
1.7 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
LADYBIRD_SOURCE_DIR="$(realpath "${DIR}"/../..)"
|
|
|
|
# shellcheck source=/dev/null
|
|
. "${LADYBIRD_SOURCE_DIR}/Meta/shell_include.sh"
|
|
|
|
# shellcheck source=/dev/null
|
|
. "${LADYBIRD_SOURCE_DIR}/Meta/find_compiler.sh"
|
|
|
|
pick_host_compiler
|
|
|
|
BUILD_DIR=${BUILD_DIR:-"${LADYBIRD_SOURCE_DIR}/Build"}
|
|
CACHE_DIR=${CACHE_DIR:-"${BUILD_DIR}/caches"}
|
|
|
|
# HACK: This export of XDG_CACHE_HOME is required to make vcpkg happy.
|
|
# This is because vcpkg tries to find a cache directory by:
|
|
# 1) checking $XDG_CACHE_HOME
|
|
# 2) appending "/.cache" to $HOME
|
|
# The problem is, in the Android build environment, neither of those environment variables are set.
|
|
# This causes vcpkg to fail; so, we set a dummy $XDG_CACHE_HOME, ensuring that vcpkg is happy.
|
|
# (Note that vcpkg appends "/vcpkg" to the cache directory we give it.)
|
|
# (And this also works on macOS, despite the fact that $XDG_CACHE_HOME is a Linux-ism.)
|
|
export XDG_CACHE_HOME="$CACHE_DIR"
|
|
|
|
"$LADYBIRD_SOURCE_DIR"/Meta/ladybird.py vcpkg
|
|
|
|
cmake -S "${LADYBIRD_SOURCE_DIR}/Meta/Lagom" -B "$BUILD_DIR/lagom-tools" \
|
|
-GNinja -Dpackage=LagomTools \
|
|
-DCMAKE_INSTALL_PREFIX="$BUILD_DIR/lagom-tools-install" \
|
|
-DCMAKE_C_COMPILER="$CC" \
|
|
-DCMAKE_CXX_COMPILER="$CXX" \
|
|
-DLADYBIRD_CACHE_DIR="$CACHE_DIR" \
|
|
-DLAGOM_TOOLS_ONLY=ON \
|
|
-DINSTALL_LAGOM_TOOLS=ON \
|
|
-DCMAKE_TOOLCHAIN_FILE="$LADYBIRD_SOURCE_DIR/Build/vcpkg/scripts/buildsystems/vcpkg.cmake" \
|
|
-DVCPKG_INSTALL_OPTIONS="--no-print-usage" \
|
|
-DVCPKG_OVERLAY_TRIPLETS="$LADYBIRD_SOURCE_DIR/Meta/CMake/vcpkg/release-triplets" \
|
|
-DVCPKG_ROOT="$LADYBIRD_SOURCE_DIR/Build/vcpkg" \
|
|
-DVCPKG_MANIFEST_DIR="$LADYBIRD_SOURCE_DIR"
|
|
|
|
ninja -C "$BUILD_DIR/lagom-tools" install
|