2019-06-21 06:29:32 +00:00
|
|
|
set(srcs
|
|
|
|
"heap.c"
|
2019-04-28 07:38:23 +00:00
|
|
|
"locks.c"
|
|
|
|
"poll.c"
|
2019-07-01 09:08:57 +00:00
|
|
|
"pread.c"
|
|
|
|
"pwrite.c"
|
2019-04-28 07:38:23 +00:00
|
|
|
"pthread.c"
|
|
|
|
"random.c"
|
|
|
|
"reent_init.c"
|
|
|
|
"select.c"
|
|
|
|
"syscall_table.c"
|
|
|
|
"syscalls.c"
|
|
|
|
"termios.c"
|
|
|
|
"time.c"
|
|
|
|
"utime.c")
|
|
|
|
set(include_dirs platform_include)
|
2018-01-12 02:49:13 +00:00
|
|
|
|
2019-11-05 11:20:26 +00:00
|
|
|
if(CONFIG_SPIRAM_CACHE_WORKAROUND)
|
|
|
|
set(ldfragments esp32-spiram-rom-functions-c.lf)
|
2019-03-08 07:07:50 +00:00
|
|
|
endif()
|
2019-04-28 03:27:30 +00:00
|
|
|
|
2019-04-28 07:38:23 +00:00
|
|
|
list(APPEND ldfragments newlib.lf)
|
2018-03-22 06:27:10 +00:00
|
|
|
|
2019-04-28 07:38:23 +00:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
|
|
INCLUDE_DIRS "${include_dirs}"
|
|
|
|
REQUIRES vfs
|
|
|
|
PRIV_REQUIRES soc
|
|
|
|
LDFRAGMENTS "${ldfragments}")
|
2018-01-12 02:49:13 +00:00
|
|
|
|
2019-11-05 11:20:26 +00:00
|
|
|
# Toolchain libraries require code defined in this component
|
|
|
|
idf_component_get_property(newlib newlib COMPONENT_LIB)
|
2019-12-11 01:55:06 +00:00
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE ${LIBC} ${LIBM} gcc "$<TARGET_FILE:${newlib}>")
|
2018-11-22 04:19:49 +00:00
|
|
|
|
2019-04-01 07:21:12 +00:00
|
|
|
set_source_files_properties(heap.c PROPERTIES COMPILE_FLAGS -fno-builtin)
|
2019-03-18 03:47:00 +00:00
|
|
|
|
2019-11-05 11:20:26 +00:00
|
|
|
# Forces the linker to include locks, heap, and syscalls from this component,
|
|
|
|
# instead of the implementations provided by newlib.
|
|
|
|
set(EXTRA_LINK_FLAGS "-u newlib_include_locks_impl")
|
|
|
|
list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_heap_impl")
|
|
|
|
list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_syscalls_impl")
|
|
|
|
list(APPEND EXTRA_LINK_FLAGS "-u newlib_include_pthread_impl")
|
|
|
|
target_link_libraries(${COMPONENT_LIB} INTERFACE "${EXTRA_LINK_FLAGS}")
|