BuildSystem: Make default libc a shared library

This commit is contained in:
Bananymous 2024-09-05 12:58:35 +03:00
parent 9aed8dbe6b
commit ddaaf89c87
2 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY True)
set(CMAKE_STATIC_LIBRARY_PREFIX "") set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_SHARED_LIBRARY_PREFIX "") set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(BUILD_SHARED_LIBS True)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")

View File

@ -85,7 +85,7 @@ install(TARGETS libc-shared OPTIONAL)
set_target_properties(libc-static PROPERTIES OUTPUT_NAME libc) 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) add_library(libc ALIAS libc-shared)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libgcc_s.so OUTPUT_VARIABLE LIBGCC_S_LINK OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libgcc_s.so OUTPUT_VARIABLE LIBGCC_S_LINK OUTPUT_STRIP_TRAILING_WHITESPACE)
file(REAL_PATH ${LIBGCC_S_LINK} LIBGCC_S) file(REAL_PATH ${LIBGCC_S_LINK} LIBGCC_S)