Files
rosetta/lib/libc/malloc/CMakeLists.txt
Max Wash 68714fa0e5 lib: c: combine libc and ulibc
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.
2026-03-06 20:12:58 +00:00

34 lines
906 B
CMake

set(source_dirs stdlib)
file(GLOB sources *.c *.h)
foreach (dir ${source_dirs})
file(GLOB dir_sources ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*.c)
file(GLOB dir_headers ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*.h)
set(sources ${sources} ${dir_sources})
set(headers ${headers} ${dir_headers})
endforeach (dir)
file(GLOB_RECURSE sub_headers ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
set(headers ${headers} ${sub_headers})
set(component_sources ${sources} PARENT_SCOPE)
set(component_headers ${headers} PARENT_SCOPE)
set(component_public_include_dirs ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
rosetta_add_library(STATIC
NAME libc-malloc
PUBLIC_INCLUDE_DIRS
${public_include_dirs}
${CMAKE_CURRENT_SOURCE_DIR}/include
SOURCES ${sources}
HEADERS ${headers})
sysroot_add_library(
NAME libc-malloc
HEADER_DIR /usr/include
LIB_DIR /usr/lib)
target_link_libraries(libc-malloc libc-core libmango)