From d9470d6a93b35d1058b5dd580e78f7c1b09034a5 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Fri, 28 Jun 2024 10:16:37 -0400 Subject: [PATCH] Meta: Add a debug build CMake preset Since the default mode now only builds release vcpkg libraries, having an easy-to-create debug build will be convenient. --- CMakePresets.json | 36 ++++++++++++------- .../vcpkg/debug-triplets/arm64-osx.cmake | 2 ++ Meta/CMake/vcpkg/debug-triplets/debug.cmake | 3 ++ .../vcpkg/debug-triplets/x64-linux.cmake | 2 ++ Meta/CMake/vcpkg/debug-triplets/x64-osx.cmake | 2 ++ 5 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 Meta/CMake/vcpkg/debug-triplets/arm64-osx.cmake create mode 100644 Meta/CMake/vcpkg/debug-triplets/debug.cmake create mode 100644 Meta/CMake/vcpkg/debug-triplets/x64-linux.cmake create mode 100644 Meta/CMake/vcpkg/debug-triplets/x64-osx.cmake diff --git a/CMakePresets.json b/CMakePresets.json index 940e694f1d2..54fbbe6665b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -30,6 +30,29 @@ } } }, + { + "name": "Debug", + "inherits": "default", + "displayName": "Debug Config", + "description": "Debug build using Ninja generator", + "binaryDir": "${sourceDir}/Build/ladybird-debug", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/debug-triplets" + } + }, + { + "name": "Sanitizer", + "inherits": "Debug", + "displayName": "Sanitizer Config", + "description": "Debug build using Sanitizers", + "binaryDir": "${sourceDir}/Build/ladybird-sanitizers", + "cacheVariables": { + "ENABLE_UNDEFINED_SANITIZER": "ON", + "ENABLE_ADDRESS_SANITIZER": "ON", + "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/sanitizer-triplets" + } + }, { "hidden": true, "name": "vcpkg_ci", @@ -38,19 +61,6 @@ "VCPKG_BINARY_SOURCES": "clear;x-gha,readwrite" } }, - { - "name": "Sanitizer", - "inherits": "default", - "displayName": "Sanitizer Config", - "description": "Debug build using Sanitizers", - "binaryDir": "${sourceDir}/Build/ladybird-sanitizers", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "ENABLE_UNDEFINED_SANITIZER": "ON", - "ENABLE_ADDRESS_SANITIZER": "ON", - "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/Meta/CMake/vcpkg/sanitizer-triplets" - } - }, { "name": "CI", "inherits": ["vcpkg_ci", "default" ], diff --git a/Meta/CMake/vcpkg/debug-triplets/arm64-osx.cmake b/Meta/CMake/vcpkg/debug-triplets/arm64-osx.cmake new file mode 100644 index 00000000000..3dadc9dd957 --- /dev/null +++ b/Meta/CMake/vcpkg/debug-triplets/arm64-osx.cmake @@ -0,0 +1,2 @@ +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/arm64-osx.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/debug.cmake) diff --git a/Meta/CMake/vcpkg/debug-triplets/debug.cmake b/Meta/CMake/vcpkg/debug-triplets/debug.cmake new file mode 100644 index 00000000000..765215e7d3d --- /dev/null +++ b/Meta/CMake/vcpkg/debug-triplets/debug.cmake @@ -0,0 +1,3 @@ +# Ideally, we would set VCPKG_BUILD_TYPE="debug", but that is currently not supported as a standalone build type. +# See: https://github.com/microsoft/vcpkg/issues/38224 +set(VCPKG_LIBRARY_LINKAGE static) diff --git a/Meta/CMake/vcpkg/debug-triplets/x64-linux.cmake b/Meta/CMake/vcpkg/debug-triplets/x64-linux.cmake new file mode 100644 index 00000000000..a7b02209c03 --- /dev/null +++ b/Meta/CMake/vcpkg/debug-triplets/x64-linux.cmake @@ -0,0 +1,2 @@ +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-linux.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/debug.cmake) diff --git a/Meta/CMake/vcpkg/debug-triplets/x64-osx.cmake b/Meta/CMake/vcpkg/debug-triplets/x64-osx.cmake new file mode 100644 index 00000000000..e606f5f99a2 --- /dev/null +++ b/Meta/CMake/vcpkg/debug-triplets/x64-osx.cmake @@ -0,0 +1,2 @@ +include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-osx.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/debug.cmake)