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.
This commit is contained in:
33
lib/libc/malloc/CMakeLists.txt
Normal file
33
lib/libc/malloc/CMakeLists.txt
Normal file
@@ -0,0 +1,33 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user