From 1d78e07f6beea62673f979d0d0844874bb1fc067 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Mon, 7 Aug 2023 19:13:06 -0600 Subject: [PATCH] Meta: Promote SERENITY_CACHE_DIR to a real option We've had it as a secret option for long enough, let's make it more visible. --- Documentation/AdvancedBuildInstructions.md | 1 + Meta/Azure/Lagom.yml | 2 +- Meta/CMake/Superbuild/CMakeLists.txt | 3 --- Meta/CMake/common_options.cmake | 2 ++ Meta/Lagom/CMakeLists.txt | 2 -- 5 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Documentation/AdvancedBuildInstructions.md b/Documentation/AdvancedBuildInstructions.md index 64678dd2b1e..ca038813492 100644 --- a/Documentation/AdvancedBuildInstructions.md +++ b/Documentation/AdvancedBuildInstructions.md @@ -67,6 +67,7 @@ There are some optional features that can be enabled during compilation that are - `SERENITY_ARCH`: Specifies which architecture to build for. Currently supported options are `x86_64`. - `BUILD_`: builds the specified component, e.g. `BUILD_HEARTS` (note: must be all caps). Check the components.ini file in your build directory for a list of available components. Make sure to run `ninja clean` and `rm -rf Build/x86_64/Root` after disabling components. These options can be easily configured by using the `ConfigureComponents` utility. See the [Component Configuration](#component-configuration) section below. - `BUILD_EVERYTHING`: builds all optional components, overrides other `BUILD_` flags when enabled +- `SERENITY_CACHE_DIR`: sets the location of a shared cache of downloaded files. Should not need to be set unless managing a distribution package. Many parts of the SerenityOS codebase have debug functionality, mostly consisting of additional messages printed to the debug console. This is done via the `_DEBUG` macros, which can be enabled individually at build time. They are listed in [this file](../Meta/CMake/all_the_debug_macros.cmake). diff --git a/Meta/Azure/Lagom.yml b/Meta/Azure/Lagom.yml index 06db02752b7..3b65b487ac1 100644 --- a/Meta/Azure/Lagom.yml +++ b/Meta/Azure/Lagom.yml @@ -51,7 +51,7 @@ jobs: os: '${{ parameters.os }}' arch: 'Lagom' toolchain: '$(toolchain)' - download_cache_path: 'Meta/Lagom/Build' + download_cache_path: 'Meta/Lagom/caches' serenity_ccache_path: '$(SERENITY_CCACHE_DIR)' with_remote_data_caches: true ${{ if eq(parameters.os, 'macOS') }}: diff --git a/Meta/CMake/Superbuild/CMakeLists.txt b/Meta/CMake/Superbuild/CMakeLists.txt index cabfc00aa1f..cac282a9459 100644 --- a/Meta/CMake/Superbuild/CMakeLists.txt +++ b/Meta/CMake/Superbuild/CMakeLists.txt @@ -44,9 +44,6 @@ if(NOT SERENITY_TOOLCHAIN STREQUAL "GNU") endif() set(SERENITY_BUILD_DIR "${PROJECT_BINARY_DIR}/../${SERENITY_ARCH}${SERENITY_BUILD_DIR_SUFFIX}") -# Location to cache artifacts downloaded during the build. -file(REAL_PATH "${PROJECT_BINARY_DIR}/../caches" SERENITY_CACHE_DIR) - # Pkgconf incorrectly discards a sysroot if it doesn't match the start of the path to the # library file. To avoid that, resolve our sysroot into an absolute and canonical path # that matches pkgconf's result for resolving the library file. diff --git a/Meta/CMake/common_options.cmake b/Meta/CMake/common_options.cmake index 1dc234ae963..235a7900c3b 100644 --- a/Meta/CMake/common_options.cmake +++ b/Meta/CMake/common_options.cmake @@ -24,3 +24,5 @@ serenity_option(HACKSTUDIO_BUILD OFF CACHE BOOL "Automatically enabled when buil serenity_option(ENABLE_JAKT OFF CACHE BOOL "Enable building jakt files") serenity_option(JAKT_SOURCE_DIR "" CACHE STRING "Pre-existing jakt language source directory") + +serenity_option(SERENITY_CACHE_DIR "${PROJECT_BINARY_DIR}/../caches" CACHE PATH "Location of shared cache of downloaded files") diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 320dc580060..0e3aa45fa01 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -25,8 +25,6 @@ get_filename_component( ) set(SerenityOS_SOURCE_DIR "${SERENITY_PROJECT_ROOT}" CACHE STRING "") -set(SERENITY_CACHE_DIR "${PROJECT_BINARY_DIR}" CACHE STRING "") - list(APPEND CMAKE_MODULE_PATH "${SERENITY_PROJECT_ROOT}/Meta/CMake") if(NOT COMMAND serenity_option)