mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Ladybird/CMake: Add options for enabling {A,M,UB}SAN
This patch adds convenient flags for enabling ASAN, MSAN and UBSAN.
This commit is contained in:
parent
8b593c9884
commit
d1b2c2977e
Notes:
sideshowbarker
2024-07-17 02:40:58 +09:00
Author: https://github.com/networkException Commit: https://github.com/SerenityOS/serenity/commit/d1b2c2977e Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling ✅ Reviewed-by: https://github.com/linusg
@ -29,6 +29,21 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
include(cmake/EnableLLD.cmake)
|
||||
|
||||
if (ENABLE_ADDRESS_SANITIZER)
|
||||
add_compile_options(-fsanitize=address -fno-omit-frame-pointer)
|
||||
add_link_options(-fsanitize=address)
|
||||
endif()
|
||||
|
||||
if (ENABLE_MEMORY_SANITIZER)
|
||||
add_compile_options(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer)
|
||||
add_link_options(-fsanitize=memory -fsanitize-memory-track-origins)
|
||||
endif()
|
||||
|
||||
if (ENABLE_UNDEFINED_SANITIZER)
|
||||
add_compile_options(-fsanitize=undefined -fno-omit-frame-pointer)
|
||||
add_link_options(-fsanitize=undefined)
|
||||
endif()
|
||||
|
||||
# Lagom
|
||||
include(FetchContent)
|
||||
include(cmake/FetchLagom.cmake)
|
||||
|
Loading…
Reference in New Issue
Block a user