mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
CMake: Use -static-libstdc++
on Clang as well
This resolves an old FIXME that we added ages ago, and our LLVM driver apparently gained support for `-static-libstdc++` somewhere along the way.
This commit is contained in:
parent
88ff01bb17
commit
671712cae6
Notes:
sideshowbarker
2024-07-17 08:45:34 +09:00
Author: https://github.com/timschumi Commit: https://github.com/SerenityOS/serenity/commit/671712cae6 Pull-request: https://github.com/SerenityOS/serenity/pull/15233 Reviewed-by: https://github.com/BenWiederhake ✅ Reviewed-by: https://github.com/bgianfo
1 changed files with 1 additions and 13 deletions
|
@ -68,19 +68,7 @@ function(serenity_libc target_name fs_name)
|
|||
set_target_properties(${target_name} PROPERTIES OUTPUT_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).
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_options(${target_name} PRIVATE -static-libstdc++)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
|
||||
target_link_libraries(${target_name} clang_rt.builtins)
|
||||
# FIXME: Implement -static-libstdc++ in the next toolchain update.
|
||||
target_link_options(${target_name} PRIVATE -nostdlib++ -Wl,-Bstatic -lc++ -Wl,-Bdynamic)
|
||||
if (NOT ENABLE_MOLD_LINKER)
|
||||
target_link_options(${target_name} PRIVATE -Wl,--no-dependent-libraries)
|
||||
endif()
|
||||
if (ENABLE_USERSPACE_COVERAGE_COLLECTION)
|
||||
target_link_libraries(${target_name} clang_rt.profile)
|
||||
endif()
|
||||
endif()
|
||||
target_link_options(${target_name} PRIVATE -static-libstdc++)
|
||||
target_link_directories(LibC PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
serenity_generated_sources(${target_name})
|
||||
endfunction()
|
||||
|
|
Loading…
Add table
Reference in a new issue