2023-04-07 02:27:15 +03:00
|
|
|
set(LIBC_SOURCES
|
2024-02-05 17:33:02 +02:00
|
|
|
arpa/inet.cpp
|
2023-05-26 22:21:07 +03:00
|
|
|
assert.cpp
|
2023-04-07 02:27:15 +03:00
|
|
|
ctype.cpp
|
2023-06-11 00:19:20 +03:00
|
|
|
dirent.cpp
|
2023-04-23 14:32:37 +03:00
|
|
|
fcntl.cpp
|
2024-01-03 00:14:49 +02:00
|
|
|
grp.cpp
|
2023-09-23 02:26:23 +03:00
|
|
|
malloc.cpp
|
2024-06-17 20:55:50 +03:00
|
|
|
netdb.cpp
|
2023-05-10 02:00:28 +03:00
|
|
|
printf_impl.cpp
|
2023-07-13 11:22:09 +03:00
|
|
|
pwd.cpp
|
2024-01-22 17:01:37 +02:00
|
|
|
scanf_impl.cpp
|
2023-07-21 15:45:02 +03:00
|
|
|
signal.cpp
|
2023-04-07 02:27:15 +03:00
|
|
|
stdio.cpp
|
|
|
|
stdlib.cpp
|
|
|
|
string.cpp
|
2023-12-14 10:59:39 +02:00
|
|
|
strings.cpp
|
2024-02-03 01:24:55 +02:00
|
|
|
stropts.cpp
|
2023-09-27 15:44:05 +03:00
|
|
|
sys/banan-os.cpp
|
2023-09-22 15:41:05 +03:00
|
|
|
sys/mman.cpp
|
2024-02-12 17:26:33 +02:00
|
|
|
sys/select.cpp
|
2024-02-01 23:39:09 +02:00
|
|
|
sys/socket.cpp
|
2023-06-05 14:36:17 +03:00
|
|
|
sys/stat.cpp
|
2023-06-04 17:59:13 +03:00
|
|
|
sys/wait.cpp
|
2023-05-16 19:22:10 +03:00
|
|
|
termios.cpp
|
2023-07-06 00:38:29 +03:00
|
|
|
time.cpp
|
2023-04-07 02:27:15 +03:00
|
|
|
unistd.cpp
|
2024-03-21 15:19:44 +02:00
|
|
|
math.cpp
|
2023-06-02 17:49:21 +03:00
|
|
|
icxxabi.cpp
|
2024-03-04 11:41:54 +02:00
|
|
|
|
2024-06-18 13:14:35 +03:00
|
|
|
../../../BAN/BAN/Assert.cpp
|
2023-04-07 02:27:15 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
add_library(libc ${LIBC_SOURCES})
|
2024-06-20 14:32:05 +03:00
|
|
|
target_compile_options(libc PRIVATE -O2 -g -Wstack-usage=512 -fno-tree-loop-distribute-patterns -nostdlib)
|
2023-12-10 19:20:14 +02:00
|
|
|
target_compile_options(libc PUBLIC -Wall -Wextra -Werror -Wno-error=stack-usage=)
|
2023-07-31 22:31:17 +03:00
|
|
|
|
2024-06-21 17:10:58 +03:00
|
|
|
function(add_crtx crtx)
|
2024-06-22 17:30:00 +03:00
|
|
|
add_custom_target(${crtx}
|
|
|
|
COMMAND ${CMAKE_CXX_COMPILER} -c -o ${CMAKE_INSTALL_LIBDIR}/${crtx}.o ${CMAKE_CURRENT_SOURCE_DIR}/arch/${BANAN_ARCH}/${crtx}.S
|
|
|
|
DEPENDS sysroot
|
|
|
|
)
|
2024-06-21 17:10:58 +03:00
|
|
|
add_dependencies(libc ${crtx})
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
add_crtx(crt0)
|
|
|
|
add_crtx(crti)
|
|
|
|
add_crtx(crtn)
|
2023-04-06 00:23:02 +03:00
|
|
|
|
2024-06-19 04:20:23 +03:00
|
|
|
banan_include_headers(libc ban)
|
|
|
|
banan_include_headers(libc kernel)
|
|
|
|
|
|
|
|
banan_install_headers(libc)
|
2024-06-20 14:32:05 +03:00
|
|
|
install(TARGETS libc OPTIONAL)
|
2024-06-19 04:20:23 +03:00
|
|
|
|
2023-04-07 02:27:15 +03:00
|
|
|
set(CMAKE_STATIC_LIBRARY_PREFIX "")
|