Meta+CI: Hook up the Lagom tools build with vcpkg

AK will depend on some vcpkg dependencies, so the Lagom tools build will
need to know how to use vcpkg. We can do this by sym-linking vcpkg.json
to Meta/Lagom (as vcpkg.json has to be in the CMake source directory).
We also need a CMakePresets.json in the source directory, which can just
include the root file. The root CMakePresets then needs to define paths
relative to ${fileDir} rather than ${sourceDir}.
This commit is contained in:
Timothy Flynn 2024-07-17 13:03:09 -04:00 committed by Andreas Kling
parent 055c902a37
commit 7c813d3992
Notes: sideshowbarker 2024-07-18 23:46:09 +09:00
5 changed files with 39 additions and 18 deletions

View file

@ -104,21 +104,20 @@ jobs:
run: | run: |
set -e set -e
cmake -GNinja -S Meta/Lagom -B ${{ github.workspace }}/tools-build \ cmake --preset=CI -S Meta/Lagom -B ${{ github.workspace }}/Build/tools-build \
-DLAGOM_TOOLS_ONLY=ON \ -DLAGOM_TOOLS_ONLY=ON \
-DINSTALL_LAGOM_TOOLS=ON \ -DINSTALL_LAGOM_TOOLS=ON \
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/tool-install \ -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/Build/tools-install \
-DSERENITY_CACHE_DIR=${{ github.workspace }}/Build/caches \
-DCMAKE_C_COMPILER=gcc-13 \ -DCMAKE_C_COMPILER=gcc-13 \
-DCMAKE_CXX_COMPILER=g++-13 \ -DCMAKE_CXX_COMPILER=g++-13 \
-Dpackage=LagomTools -Dpackage=LagomTools
ninja -C tools-build install ninja -C ${{ github.workspace }}/Build/tools-build install
cmake --preset Fuzzers_CI -B Build \ cmake --preset Fuzzers_CI -B Build \
-DCMAKE_C_COMPILER=${{ steps.build-parameters.outputs.host_cc }} \ -DCMAKE_C_COMPILER=${{ steps.build-parameters.outputs.host_cc }} \
-DCMAKE_CXX_COMPILER=${{ steps.build-parameters.outputs.host_cxx }} \ -DCMAKE_CXX_COMPILER=${{ steps.build-parameters.outputs.host_cxx }} \
-DCMAKE_PREFIX_PATH=${{ github.workspace }}/tool-install -DCMAKE_PREFIX_PATH=${{ github.workspace }}/Build/tools-install
# === BUILD === # === BUILD ===

View file

@ -11,18 +11,18 @@
"displayName": "Default Config", "displayName": "Default Config",
"description": "Default build using Ninja generator", "description": "Default build using Ninja generator",
"generator": "Ninja", "generator": "Ninja",
"binaryDir": "${sourceDir}/Build/ladybird", "binaryDir": "${fileDir}/Build/ladybird",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_BUILD_TYPE": "RelWithDebInfo",
"SERENITY_CACHE_DIR": "${sourceDir}/Build/caches", "SERENITY_CACHE_DIR": "${fileDir}/Build/caches",
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/Toolchain/Tarballs/vcpkg/scripts/buildsystems/vcpkg.cmake", "CMAKE_TOOLCHAIN_FILE": "${fileDir}/Toolchain/Tarballs/vcpkg/scripts/buildsystems/vcpkg.cmake",
"VCPKG_INSTALL_OPTIONS": "--no-print-usage", "VCPKG_INSTALL_OPTIONS": "--no-print-usage",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/release-triplets" "VCPKG_OVERLAY_TRIPLETS": "${fileDir}/Meta/CMake/vcpkg/release-triplets"
}, },
"environment": { "environment": {
"LADYBIRD_SOURCE_DIR": "${sourceDir}", "LADYBIRD_SOURCE_DIR": "${fileDir}",
"VCPKG_ROOT": "${sourceDir}/Toolchain/Tarballs/vcpkg", "VCPKG_ROOT": "${fileDir}/Toolchain/Tarballs/vcpkg",
"VCPKG_BINARY_SOURCES": "clear;files,${sourceDir}/Toolchain/Build/vcpkg-binary-cache,readwrite" "VCPKG_BINARY_SOURCES": "clear;files,${fileDir}/Toolchain/Build/vcpkg-binary-cache,readwrite"
}, },
"vendor": { "vendor": {
"jetbrains.com/clion": { "jetbrains.com/clion": {
@ -35,10 +35,10 @@
"inherits": "default", "inherits": "default",
"displayName": "Debug Config", "displayName": "Debug Config",
"description": "Debug build using Ninja generator", "description": "Debug build using Ninja generator",
"binaryDir": "${sourceDir}/Build/ladybird-debug", "binaryDir": "${fileDir}/Build/ladybird-debug",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug", "CMAKE_BUILD_TYPE": "Debug",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/debug-triplets" "VCPKG_OVERLAY_TRIPLETS": "${fileDir}/Meta/CMake/vcpkg/debug-triplets"
} }
}, },
{ {
@ -46,11 +46,11 @@
"inherits": "Debug", "inherits": "Debug",
"displayName": "Sanitizer Config", "displayName": "Sanitizer Config",
"description": "Debug build using Sanitizers", "description": "Debug build using Sanitizers",
"binaryDir": "${sourceDir}/Build/ladybird-sanitizers", "binaryDir": "${fileDir}/Build/ladybird-sanitizers",
"cacheVariables": { "cacheVariables": {
"ENABLE_UNDEFINED_SANITIZER": "ON", "ENABLE_UNDEFINED_SANITIZER": "ON",
"ENABLE_ADDRESS_SANITIZER": "ON", "ENABLE_ADDRESS_SANITIZER": "ON",
"VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/sanitizer-triplets" "VCPKG_OVERLAY_TRIPLETS": "${fileDir}/Meta/CMake/vcpkg/sanitizer-triplets"
} }
}, },
{ {
@ -79,7 +79,7 @@
"inherits": ["vcpkg_ci", "default" ], "inherits": ["vcpkg_ci", "default" ],
"displayName": "Fuzzers Config", "displayName": "Fuzzers Config",
"description": "Fuzzers build with GitHub Actions cache", "description": "Fuzzers build with GitHub Actions cache",
"binaryDir": "${sourceDir}/Build/ladybird-fuzzers", "binaryDir": "${fileDir}/Build/ladybird-fuzzers",
"cacheVariables": { "cacheVariables": {
"CMAKE_BUILD_TYPE": "", "CMAKE_BUILD_TYPE": "",
"ENABLE_QT": "OFF", "ENABLE_QT": "OFF",
@ -120,7 +120,7 @@
"stopOnFailure": true "stopOnFailure": true
}, },
"environment": { "environment": {
"LADYBIRD_SOURCE_DIR": "${sourceDir}" "LADYBIRD_SOURCE_DIR": "${fileDir}"
} }
}, },
{ {

View file

@ -0,0 +1,11 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"patch": 0
},
"include": [
"../../CMakePresets.json"
]
}

View file

@ -0,0 +1,10 @@
{
"registries": [
{
"kind": "artifact",
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
"name": "microsoft"
}
],
"overlay-ports": [ "../../Meta/CMake/vcpkg/overlay-ports" ]
}

1
Meta/Lagom/vcpkg.json Symbolic link
View file

@ -0,0 +1 @@
../../vcpkg.json