1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:07:45 +00:00

Meta+Userland: Add ENABLE_USERSPACE_COVERAGE_COLLECTION CMake option

This option sets -fprofile-instr-generate -fcoverage-mapping for Clang
builds only on almost all of Userland. Loader and LibTimeZone are
exempt. This can be used for generating code coverage reports, or even
PGO in the future.
This commit is contained in:
Andrew Kaster 2022-03-04 18:02:09 -07:00 committed by Andreas Kling
parent a6b2c34746
commit 5120b39d0e
9 changed files with 39 additions and 2 deletions

View file

@ -44,6 +44,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
target_link_libraries(Loader.so PRIVATE clang_rt.builtins)
endif ()
target_link_libraries(Loader.so PRIVATE LibTimeZone)
# Note: Don't confuse the coverage results by instrumenting Loader
target_link_libraries(Loader.so PRIVATE LibTimeZone NoCoverage)
target_link_options(Loader.so PRIVATE LINKER:--no-dynamic-linker)
install(TARGETS Loader.so RUNTIME DESTINATION usr/lib/)