banan-os/libc/CMakeLists.txt

35 lines
636 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.26)
2023-05-10 22:35:20 +03:00
project(libc CXX ASM)
set(LIBC_SOURCES
assert.cpp
ctype.cpp
2023-04-23 14:32:37 +03:00
fcntl.cpp
printf_impl.cpp
stdio.cpp
stdlib.cpp
string.cpp
sys/wait.cpp
termios.cpp
unistd.cpp
2023-05-10 22:35:20 +03:00
math.S
2023-06-02 17:49:21 +03:00
icxxabi.cpp
)
add_custom_target(libc-headers
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include ${BANAN_INCLUDE}
DEPENDS sysroot
)
add_library(libc ${LIBC_SOURCES})
add_dependencies(libc headers crt0)
add_custom_target(libc-install
COMMAND cp ${CMAKE_CURRENT_BINARY_DIR}/libc.a ${BANAN_LIB}/
DEPENDS libc
BYPRODUCTS ${BANAN_LIB}/libc.a
)
set(CMAKE_STATIC_LIBRARY_PREFIX "")