ladybird/Ladybird/Android/BuildLagomTools.sh
Andrew Kaster 920dc1ba53 Ladybird/Android: Move host build into its own shell script
This lets us select a proper host compiler version if cc/cxx are not
suitable for building Lagom.
2023-09-08 09:01:34 -06:00

28 lines
715 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SERENITY_ROOT="$(realpath "${DIR}"/../..)"
# shellcheck source=/dev/null
. "${SERENITY_ROOT}/Meta/shell_include.sh"
# shellcheck source=/dev/null
. "${SERENITY_ROOT}/Meta/find_compiler.sh"
pick_host_compiler
BUILD_DIR=${BUILD_DIR:-"${SERENITY_ROOT}/Build"}
CACHE_DIR=${CACHE_DIR:-"${BUILD_DIR}/caches"}
cmake -S "$SERENITY_ROOT/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" \
-DSERENITY_CACHE_DIR="$CACHE_DIR"
ninja -C "$BUILD_DIR/lagom-tools" install