lib: add libc and micro libc
This commit is contained in:
36
lib/libc/CMakeLists.txt
Normal file
36
lib/libc/CMakeLists.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
set(source_dirs string stdio)
|
||||
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 runtime_sources
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/runtime/${CMAKE_SYSTEM_PROCESSOR}/*.s)
|
||||
set_property(SOURCE ${runtime_sources} PROPERTY LANGUAGE C)
|
||||
|
||||
set(public_include_dirs
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
rosetta_add_library(SHARED
|
||||
NAME libc
|
||||
PUBLIC_INCLUDE_DIRS ${public_include_dirs}
|
||||
SOURCES ${sources}
|
||||
HEADERS ${headers})
|
||||
|
||||
rosetta_add_object_library(
|
||||
NAME libc-rt STATIC
|
||||
SOURCES ${runtime_sources})
|
||||
|
||||
sysroot_add_library(
|
||||
NAME libc
|
||||
HEADER_DIR /usr/include
|
||||
LIB_DIR /usr/lib)
|
||||
sysroot_add_object_library(
|
||||
NAME libc-rt
|
||||
LIB_DIR /usr/lib)
|
||||
bsp_add_library(
|
||||
NAME libc
|
||||
LIB_DIR /usr/lib)
|
||||
Reference in New Issue
Block a user