ladybird/Userland/Libraries/LibSystem/CMakeLists.txt
Dan Klishch 61cf20582c DynamicLoader+LibC: Link LibC into DynamicLoader --as-sane-people
In particular, define a static LibC library *in LibC's CMakeLists* and
use it in DynamicLoader. This is similar to the way LibELF is included
in DynamicLoader.

Additionally, compile DynamicLoader with -ffunction-sections,
-fdata-sections, and -Wl,--gc-sections. This brings the loader size from
~2Mb to ~1Mb with debug symbols and from ~500Kb to ~150Kb without. Also,
this makes linking DynamicLoader with LibTimeZone unnecessary.
2024-05-07 16:39:17 -06:00

11 lines
300 B
CMake

set(SOURCES
syscall.cpp
)
serenity_libc(LibSystem system)
add_dependencies(LibSystem install_libc_headers)
target_link_options(LibSystem PRIVATE -nostdlib)
add_library(DynamicLoader_LibSystem STATIC ${SOURCES})
target_link_libraries(DynamicLoader_LibSystem PUBLIC DynamicLoader_CompileOptions)