pico-sdk/src/common/pico_util/CMakeLists.txt
Graham Sanderson 0e4e25a343
Rework build targets such that: (#1211)
1. Make sure Pico SDK libraries have the correct dependencies on other SDK libraries
2. Pico SDK libraries all have _headers variants to include the headers. This may facilitate building user STATIC libraries without
   pulling in SDK code, though care will still need to be taken w.r.t. values of #defines
3. Make sure the _headers versions also have the correct dependencies

Note: There are a few exceptions to 1. for some non code libraries like pico_standard_link and pico_cxx_options
2023-01-30 10:56:03 -06:00

16 lines
605 B
CMake

if (NOT TARGET pico_util_headers)
add_library(pico_util_headers INTERFACE)
target_include_directories(pico_util_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
target_link_libraries(pico_util_headers INTERFACE pico_base_headers hardware_sync_headers)
endif()
if (NOT TARGET pico_util)
pico_add_impl_library(pico_util)
target_sources(pico_util INTERFACE
${CMAKE_CURRENT_LIST_DIR}/datetime.c
${CMAKE_CURRENT_LIST_DIR}/pheap.c
${CMAKE_CURRENT_LIST_DIR}/queue.c
)
pico_mirrored_target_link_libraries(pico_util INTERFACE pico_sync)
endif()