1if (NOT TARGET pico_stdlib)
2    pico_add_impl_library(pico_stdlib)
3    target_sources(pico_stdlib INTERFACE
4            ${CMAKE_CURRENT_LIST_DIR}/stdlib.c
5    )
6
7    set(PICO_STDLIB_LIBRARIES
8            hardware_gpio
9            hardware_uart
10            hardware_divider
11            pico_time
12            pico_util
13            pico_platform
14            pico_runtime
15            pico_stdio
16    )
17    foreach(LIB IN LISTS PICO_STDLIB_LIBRARIES)
18        if (TARGET ${LIB})
19            pico_mirrored_target_link_libraries(pico_stdlib INTERFACE ${LIB})
20        endif()
21    endforeach()
22endif()
23