mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
LibC: Also build a static version of libc
This commit is contained in:
parent
d89858f42a
commit
0220b5361e
Notes:
sideshowbarker
2024-07-19 00:50:23 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/0220b5361ea Pull-request: https://github.com/SerenityOS/serenity/pull/3738 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/awesomekling
2 changed files with 15 additions and 0 deletions
|
@ -147,6 +147,16 @@ function(serenity_libc target_name fs_name)
|
|||
serenity_generated_sources(${target_name})
|
||||
endfunction()
|
||||
|
||||
function(serenity_libc_static target_name fs_name)
|
||||
serenity_install_headers("")
|
||||
serenity_install_sources("Libraries/LibC")
|
||||
add_library(${target_name} ${SOURCES})
|
||||
install(TARGETS ${target_name} ARCHIVE DESTINATION usr/lib)
|
||||
set_target_properties(${target_name} PROPERTIES OUTPUT_NAME ${fs_name})
|
||||
target_link_directories(${target_name} PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
|
||||
serenity_generated_sources(${target_name})
|
||||
endfunction()
|
||||
|
||||
function(serenity_bin target_name)
|
||||
add_executable(${target_name} ${SOURCES})
|
||||
target_sources(${target_name} PRIVATE ${CMAKE_SOURCE_DIR}/Libraries/LibC/crt0_shared.cpp)
|
||||
|
|
|
@ -66,6 +66,11 @@ add_custom_command(
|
|||
)
|
||||
|
||||
set(SOURCES ${LIBC_SOURCES} ${AK_SOURCES} ${ELF_SOURCES})
|
||||
|
||||
serenity_libc_static(LibCStatic c)
|
||||
target_link_libraries(LibCStatic crt0)
|
||||
add_dependencies(LibCStatic LibM)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
|
||||
serenity_libc(LibC c)
|
||||
target_link_libraries(LibC crt0)
|
||||
|
|
Loading…
Reference in a new issue