mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:17:34 +00:00
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.
This commit is contained in:
parent
bd7d01e975
commit
920dc1ba53
2 changed files with 37 additions and 6 deletions
27
Ladybird/Android/BuildLagomTools.sh
Executable file
27
Ladybird/Android/BuildLagomTools.sh
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/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
|
|
@ -7,12 +7,13 @@ plugins {
|
||||||
|
|
||||||
var cacheDir = System.getenv("SERENITY_CACHE_DIR") ?: "$buildDir/caches"
|
var cacheDir = System.getenv("SERENITY_CACHE_DIR") ?: "$buildDir/caches"
|
||||||
|
|
||||||
// FIXME: Move this somewhere nicer, with better behavior (like controlling host compiler)
|
|
||||||
task<Exec>("buildLagomTools") {
|
task<Exec>("buildLagomTools") {
|
||||||
commandLine = listOf("sh", "-c", "cmake -S ../../Meta/Lagom -B $buildDir/lagom-tools " +
|
commandLine = listOf("./BuildLagomTools.sh")
|
||||||
" -Dpackage=LagomTools -DCMAKE_INSTALL_PREFIX=$buildDir/lagom-tools-install -GNinja" +
|
environment = mapOf(
|
||||||
" -DSERENITY_CACHE_DIR=$cacheDir;" +
|
"BUILD_DIR" to "$buildDir",
|
||||||
" ninja -C $buildDir/lagom-tools install")
|
"CACHE_DIR" to "$cacheDir",
|
||||||
|
"PATH" to System.getenv("PATH")!!
|
||||||
|
)
|
||||||
}
|
}
|
||||||
tasks.named("preBuild").dependsOn("buildLagomTools")
|
tasks.named("preBuild").dependsOn("buildLagomTools")
|
||||||
|
|
||||||
|
@ -47,7 +48,10 @@ android {
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
isMinifyEnabled = false
|
isMinifyEnabled = false
|
||||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue