mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-26 06:49:12 +03: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
Notes:
sideshowbarker
2024-07-17 06:51:48 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/920dc1ba53 Pull-request: https://github.com/SerenityOS/serenity/pull/20980
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"
|
||||
|
||||
// FIXME: Move this somewhere nicer, with better behavior (like controlling host compiler)
|
||||
task<Exec>("buildLagomTools") {
|
||||
commandLine = listOf("sh", "-c", "cmake -S ../../Meta/Lagom -B $buildDir/lagom-tools " +
|
||||
" -Dpackage=LagomTools -DCMAKE_INSTALL_PREFIX=$buildDir/lagom-tools-install -GNinja" +
|
||||
" -DSERENITY_CACHE_DIR=$cacheDir;" +
|
||||
" ninja -C $buildDir/lagom-tools install")
|
||||
commandLine = listOf("./BuildLagomTools.sh")
|
||||
environment = mapOf(
|
||||
"BUILD_DIR" to "$buildDir",
|
||||
"CACHE_DIR" to "$cacheDir",
|
||||
"PATH" to System.getenv("PATH")!!
|
||||
)
|
||||
}
|
||||
tasks.named("preBuild").dependsOn("buildLagomTools")
|
||||
|
||||
@ -47,7 +48,10 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = false
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
)
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
|
Loading…
Reference in New Issue
Block a user