Skip to content

Commit

Permalink
Meta: Add a debug build CMake preset
Browse files Browse the repository at this point in the history
Since the default mode now only builds release vcpkg libraries, having
an easy-to-create debug build will be convenient.
  • Loading branch information
trflynn89 committed Jun 28, 2024
1 parent 1c2aef9 commit d9470d6
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
24 changes: 17 additions & 7 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,26 +31,36 @@
}
},
{
"hidden": true,
"name": "vcpkg_ci",
"description": "Use the GitHub Actions vcpkg cache",
"environment": {
"VCPKG_BINARY_SOURCES": "clear;x-gha,readwrite"
"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": "default",
"inherits": "Debug",
"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"
}
},
{
"hidden": true,
"name": "vcpkg_ci",
"description": "Use the GitHub Actions vcpkg cache",
"environment": {
"VCPKG_BINARY_SOURCES": "clear;x-gha,readwrite"
}
},
{
"name": "CI",
"inherits": ["vcpkg_ci", "default" ],
Expand Down
2 changes: 2 additions & 0 deletions Meta/CMake/vcpkg/debug-triplets/arm64-osx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/arm64-osx.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/debug.cmake)
3 changes: 3 additions & 0 deletions Meta/CMake/vcpkg/debug-triplets/debug.cmake
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions Meta/CMake/vcpkg/debug-triplets/x64-linux.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-linux.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/debug.cmake)
2 changes: 2 additions & 0 deletions Meta/CMake/vcpkg/debug-triplets/x64-osx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include (${CMAKE_CURRENT_LIST_DIR}/../base-triplets/x64-osx.cmake)
include (${CMAKE_CURRENT_LIST_DIR}/debug.cmake)

0 comments on commit d9470d6

Please sign in to comment.