libc is now made up of several independent components, each of which is individually compiled into a static library. they are then all combined into a single shared library.
31 lines
714 B
CMake
31 lines
714 B
CMake
set(source_dirs core malloc)
|
|
|
|
set(public_include_dirs
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
add_subdirectory(runtime)
|
|
|
|
foreach (dir ${source_dirs})
|
|
add_subdirectory(${dir})
|
|
set(sources ${sources} ${component_sources})
|
|
set(headers ${headers} ${component_headers})
|
|
set(public_include_dirs ${public_include_dirs} ${component_public_include_dirs})
|
|
endforeach (dir)
|
|
|
|
rosetta_add_library(SHARED
|
|
NAME libc
|
|
PUBLIC_INCLUDE_DIRS ${public_include_dirs}
|
|
SOURCES ${sources}
|
|
HEADERS ${headers})
|
|
|
|
sysroot_add_library(
|
|
NAME libc
|
|
HEADER_DIR /usr/include
|
|
LIB_DIR /usr/lib)
|
|
bsp_add_library(
|
|
NAME libc
|
|
LIB_DIR /usr/lib)
|
|
|
|
target_link_libraries(libc libmango)
|
|
target_compile_definitions(libc PRIVATE ENABLE_GLOBAL_HEAP=1)
|