LibC: Compile both static and shared version of LibC

libc target is now set as an alias for libc-static
This commit is contained in:
Bananymous 2024-09-02 21:28:02 +03:00
parent 5f92807fdd
commit 35743cc8e6
1 changed files with 6 additions and 3 deletions

View File

@ -72,16 +72,19 @@ banan_include_headers(objlibc kernel)
banan_install_headers(objlibc) banan_install_headers(objlibc)
add_library(libc STATIC $<TARGET_OBJECTS:objlibc>) add_library(libc-static STATIC $<TARGET_OBJECTS:objlibc>)
add_library(libc-shared SHARED $<TARGET_OBJECTS:objlibc>) add_library(libc-shared SHARED $<TARGET_OBJECTS:objlibc>)
target_link_options(libc PRIVATE -nolibc) target_link_options(libc-static PRIVATE -nolibc)
target_link_options(libc-shared PRIVATE -nolibc) target_link_options(libc-shared PRIVATE -nolibc)
install(TARGETS libc OPTIONAL) install(TARGETS libc-static OPTIONAL)
install(TARGETS libc-shared OPTIONAL) install(TARGETS libc-shared OPTIONAL)
set_target_properties(libc-static PROPERTIES OUTPUT_NAME libc)
set_target_properties(libc-shared PROPERTIES OUTPUT_NAME libc) set_target_properties(libc-shared PROPERTIES OUTPUT_NAME libc)
add_library(libc ALIAS libc-static)
set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "") set(CMAKE_SHARED_LIBRARY_PREFIX "")