Skip to content

Commit

Permalink
CMake: Force-link clang_rt.profile.a to LibC when building with coverage
Browse files Browse the repository at this point in the history
This used to be in place until 671712c.

I had commented on that PR that "yeah should be good to remove". Turns
out that's not the case. A future patch to the clang driver might make
this obsolete :^).
  • Loading branch information
ADKaster authored and linusg committed Dec 10, 2022
1 parent bee31d2 commit 8356677
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Meta/CMake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ function(serenity_libc target_name fs_name)
# Avoid creating a dependency cycle between system libraries and the C++ standard library. This is necessary
# to ensure that initialization functions will be called in the right order (libc++ must come after LibPthread).
target_link_options(${target_name} PRIVATE -static-libstdc++)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$" AND ENABLE_USERSPACE_COVERAGE_COLLECTION)
target_link_libraries(${target_name} PRIVATE clang_rt.profile)
endif()
target_link_directories(LibC PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
serenity_generated_sources(${target_name})
endfunction()
Expand Down

0 comments on commit 8356677

Please sign in to comment.