1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

Meta: Allow collecting code coverage on Lagom

This commit is contained in:
Dan Klishch 2024-02-24 12:17:57 -05:00 committed by Andrew Kaster
parent 7fbc8bf719
commit 9966feab4d
2 changed files with 11 additions and 0 deletions

View file

@ -34,3 +34,13 @@ add_linker_flag_if_supported(LINKER:--gdb-index)
if (NOT ENABLE_FUZZERS)
add_linker_flag_if_supported(LINKER:-Bsymbolic-non-weak-functions)
endif()
if (ENABLE_LAGOM_COVERAGE_COLLECTION)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$" AND NOT ENABLE_FUZZERS)
add_compile_options(-fprofile-instr-generate -fcoverage-mapping)
add_link_options(-fprofile-instr-generate)
else()
message(FATAL_ERROR
"Collecting code coverage is unsupported in this configuration.")
endif()
endif()

View file

@ -15,3 +15,4 @@ serenity_option(ENABLE_LAGOM_CCACHE ON CACHE BOOL "Enable ccache for Lagom build
serenity_option(ENABLE_LAGOM_LIBWEB ON CACHE BOOL "Enable compiling LibWeb for Lagom builds")
serenity_option(ENABLE_LAGOM_LADYBIRD OFF CACHE BOOL "Enable compiling Ladybird from Lagom")
serenity_option(LAGOM_USE_LINKER "" CACHE STRING "The linker to use (e.g. lld, mold) instead of the system default")
serenity_option(ENABLE_LAGOM_COVERAGE_COLLECTION OFF CACHE STRING "Enable code coverage instrumentation for lagom binaries in clang")