AK: Add stacktrace support using the standard lib

This commit adds support for using the standard library implementation
of <stacktrace> if libbacktrace is not found. This can also be
explicitly enabled through ENABLE_STD_STACKTRACE for platforms that have
libbacktrace available.

Co-Authored-By: Andrew Kaster <andrew@ladybird.org>
This commit is contained in:
R-Goc 2025-02-08 23:05:42 +01:00 committed by Andrew Kaster
commit fe26c3145d
Notes: github-actions[bot] 2025-03-05 17:26:11 +00:00
4 changed files with 103 additions and 18 deletions

View file

@ -13,6 +13,11 @@ if (POLICY CMP0157)
set(CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>")
endif()
# Check arguments to return()
if (POLICY CMP0140)
cmake_policy(SET CMP0140 NEW)
endif()
serenity_option(ENABLE_COMPILETIME_FORMAT_CHECK ON CACHE BOOL "Enable compiletime format string checks")
serenity_option(ENABLE_UNDEFINED_SANITIZER OFF CACHE BOOL "Enable undefined behavior sanitizer testing in gcc/clang")
serenity_option(UNDEFINED_BEHAVIOR_IS_FATAL OFF CACHE BOOL "Make undefined behavior sanitizer errors non-recoverable")
@ -35,6 +40,7 @@ serenity_option(ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS OFF CACHE BOOL "En
serenity_option(ENABLE_GUI_TARGETS ON CACHE BOOL "Enable building GUI targets")
serenity_option(ENABLE_INSTALL_HEADERS ON CACHE BOOL "Enable installing headers")
serenity_option(ENABLE_SWIFT OFF CACHE BOOL "Enable building Swift files")
serenity_option(ENABLE_STD_STACKTRACE OFF CACHE BOOL "Force use of std::stacktrace instead of libbacktrace. If it is not supported the build will fail")
if (ENABLE_SWIFT)
include(${CMAKE_CURRENT_LIST_DIR}/Swift/swift-settings.cmake)