2023-04-02 04:07:27 +03:00
|
|
|
cmake_minimum_required(VERSION 3.26)
|
|
|
|
|
|
|
|
project(libc CXX)
|
|
|
|
|
2023-04-07 02:27:15 +03:00
|
|
|
set(LIBC_SOURCES
|
|
|
|
ctype.cpp
|
|
|
|
stdio.cpp
|
|
|
|
stdlib.cpp
|
|
|
|
string.cpp
|
|
|
|
unistd.cpp
|
|
|
|
)
|
|
|
|
|
2023-04-06 00:23:02 +03:00
|
|
|
add_custom_target(libc-headers
|
2023-04-10 20:27:20 +03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include ${BANAN_INCLUDE}
|
2023-04-02 04:07:27 +03:00
|
|
|
DEPENDS sysroot
|
|
|
|
)
|
2023-04-06 00:23:02 +03:00
|
|
|
|
2023-04-07 02:27:15 +03:00
|
|
|
add_library(libc ${LIBC_SOURCES})
|
2023-04-10 20:27:20 +03:00
|
|
|
add_dependencies(libc headers crt0)
|
2023-04-07 02:27:15 +03:00
|
|
|
|
2023-04-06 00:23:02 +03:00
|
|
|
add_custom_target(libc-install
|
2023-04-07 02:27:15 +03:00
|
|
|
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/libc.a ${BANAN_LIB}/
|
|
|
|
DEPENDS libc
|
2023-04-06 00:23:02 +03:00
|
|
|
)
|
|
|
|
|
2023-04-07 02:27:15 +03:00
|
|
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|