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
This commit is contained in:
Graham Sanderson
2023-01-30 10:56:03 -06:00
committed by GitHub
parent d717fe239a
commit 0e4e25a343
65 changed files with 339 additions and 268 deletions

View File

@ -1,5 +1,5 @@
if (NOT TARGET pico_standard_link)
pico_add_impl_library(pico_standard_link)
pico_add_library(pico_standard_link NOFLAG)
target_sources(pico_standard_link INTERFACE
${CMAKE_CURRENT_LIST_DIR}/crt0.S
@ -14,7 +14,8 @@ if (NOT TARGET pico_standard_link)
target_link_options(pico_standard_link INTERFACE "LINKER:-nostdlib")
endif ()
target_link_libraries(pico_standard_link INTERFACE hardware_regs boot_stage2_headers pico_bootrom pico_binary_info pico_cxx_options)
pico_mirrored_target_link_libraries(pico_standard_link INTERFACE hardware_regs pico_bootrom pico_binary_info)
target_link_libraries(pico_standard_link INTERFACE pico_cxx_options boot_stage2_headers)
function(pico_add_link_depend TARGET dependency)
get_target_property(target_type ${TARGET} TYPE)