mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibC: Also build a static version of libc
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user