Meta: Build CMake from source if version is too old in serenity.sh

This commit is contained in:
Andrew Kaster 2022-12-10 13:33:16 -07:00 committed by Andreas Kling
parent e4a59f664b
commit 3ca661314f

View file

@ -241,6 +241,7 @@ cmd_with_target() {
SUPER_BUILD_DIR="$BUILD_DIR"
CMAKE_ARGS+=("-DCMAKE_INSTALL_PREFIX=$SERENITY_SOURCE_DIR/Build/lagom-install")
fi
export PATH="$SERENITY_SOURCE_DIR/Toolchain/Local/cmake/bin":$PATH
}
ensure_target() {
@ -289,6 +290,11 @@ delete_target() {
[ ! -d "$SUPER_BUILD_DIR" ] || rm -rf "$SUPER_BUILD_DIR"
}
build_cmake() {
echo "CMake version too old: build_cmake"
( cd "$SERENITY_SOURCE_DIR/Toolchain" && ./BuildCMake.sh )
}
build_toolchain() {
echo "build_toolchain: $TOOLCHAIN_DIR"
if [ "$TOOLCHAIN_TYPE" = "Clang" ]; then
@ -299,6 +305,9 @@ build_toolchain() {
}
ensure_toolchain() {
if [ "$(cmake -P "$SERENITY_SOURCE_DIR"/Meta/CMake/cmake-version.cmake)" -ne 1 ]; then
build_cmake
fi
[ -d "$TOOLCHAIN_DIR" ] || build_toolchain
if [ "$TOOLCHAIN_TYPE" = "GNU" ]; then