Fix build backwards-incompatibilities with LIB_XXX defines, and add fix pico_time in host mode (#1232)

* restore original setters of LIB_PICO_ as some external code depends on it

* add __get_current_exception to host
This commit is contained in:
Graham Sanderson 2023-02-07 16:39:37 -06:00 committed by GitHub
parent 18b97fcba0
commit 8c8006d457
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 19 additions and 17 deletions

View File

@ -11,4 +11,3 @@ if (NOT TARGET pico_base_headers)
list(APPEND PICO_SDK_POST_LIST_FILES ${CMAKE_CURRENT_LIST_DIR}/generate_config_header.cmake) list(APPEND PICO_SDK_POST_LIST_FILES ${CMAKE_CURRENT_LIST_DIR}/generate_config_header.cmake)
pico_promote_common_scope_vars() pico_promote_common_scope_vars()
endif() endif()

View File

@ -143,6 +143,9 @@ static inline void __compiler_memory_barrier(void) {
uint get_core_num(); uint get_core_num();
static inline uint __get_current_exception(void) {
return 0;
}
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -1,5 +1,5 @@
if (NOT TARGET pico_stdio) if (NOT TARGET pico_stdio)
pico_add_library(pico_stdio NOFLAG) pico_add_library(pico_stdio)
target_include_directories(pico_stdio_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) target_include_directories(pico_stdio_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

View File

@ -1,6 +1,6 @@
if (PICO_CYW43_SUPPORTED) # set by BOARD=pico-w if (PICO_CYW43_SUPPORTED) # set by BOARD=pico-w
if (TARGET cyw43_driver_picow) if (TARGET cyw43_driver_picow)
pico_add_library(pico_cyw43_arch NOFLAG) pico_add_library(pico_cyw43_arch)
target_sources(pico_cyw43_arch INTERFACE target_sources(pico_cyw43_arch INTERFACE
${CMAKE_CURRENT_LIST_DIR}/cyw43_arch.c ${CMAKE_CURRENT_LIST_DIR}/cyw43_arch.c
${CMAKE_CURRENT_LIST_DIR}/cyw43_arch_poll.c ${CMAKE_CURRENT_LIST_DIR}/cyw43_arch_poll.c

View File

@ -3,7 +3,7 @@ if (NOT TARGET pico_divider)
pico_add_impl_library(pico_divider) pico_add_impl_library(pico_divider)
# no custom implementation; falls thru to compiler # no custom implementation; falls thru to compiler
add_library(pico_divider_compiler INTERFACE) pico_add_library(pico_divider_compiler)
# add alias "default" which is just hardware. # add alias "default" which is just hardware.
add_library(pico_divider_default INTERFACE) add_library(pico_divider_default INTERFACE)
@ -25,7 +25,7 @@ if (NOT TARGET pico_divider)
hardware_regs hardware_regs
) )
add_library(pico_divider_hardware INTERFACE) pico_add_library(pico_divider_hardware)
target_link_libraries(pico_divider_hardware INTERFACE pico_divider_hardware_explicit) target_link_libraries(pico_divider_hardware INTERFACE pico_divider_hardware_explicit)

View File

@ -1,4 +1,4 @@
pico_add_library(pico_fix_rp2040_usb_device_enumeration NOFLAG) pico_add_library(pico_fix_rp2040_usb_device_enumeration)
target_sources(pico_fix_rp2040_usb_device_enumeration INTERFACE target_sources(pico_fix_rp2040_usb_device_enumeration INTERFACE
${CMAKE_CURRENT_LIST_DIR}/rp2040_usb_device_enumeration.c ${CMAKE_CURRENT_LIST_DIR}/rp2040_usb_device_enumeration.c

View File

@ -1,6 +1,6 @@
if (NOT TARGET pico_float) if (NOT TARGET pico_float)
# library to be depended on - we make this depend on particular implementations using per target generator expressions # library to be depended on - we make this depend on particular implementations using per target generator expressions
pico_add_library(pico_float NOFLAG) pico_add_library(pico_float)
# no custom implementation; falls thru to compiler # no custom implementation; falls thru to compiler
pico_add_library(pico_float_compiler) pico_add_library(pico_float_compiler)

View File

@ -1,7 +1,7 @@
if (NOT TARGET pico_int64_ops) if (NOT TARGET pico_int64_ops)
#shims for ROM functions for -lgcc functions (listed below) #shims for ROM functions for -lgcc functions (listed below)
pico_add_library(pico_int64_ops NOFLAG) pico_add_library(pico_int64_ops)
# no custom implementation; falls thru to compiler # no custom implementation; falls thru to compiler
pico_add_library(pico_int64_ops_compiler) pico_add_library(pico_int64_ops_compiler)

View File

@ -1,6 +1,6 @@
if (NOT TARGET pico_malloc) if (NOT TARGET pico_malloc)
#shims for ROM functions for -lgcc functions (listed below) #shims for ROM functions for -lgcc functions (listed below)
pico_add_library(pico_malloc NOFLAG) pico_add_library(pico_malloc)
target_sources(pico_malloc INTERFACE target_sources(pico_malloc INTERFACE
${CMAKE_CURRENT_LIST_DIR}/pico_malloc.c ${CMAKE_CURRENT_LIST_DIR}/pico_malloc.c

View File

@ -3,7 +3,7 @@ if (NOT TARGET pico_mem_ops)
pico_add_library(pico_mem_ops) pico_add_library(pico_mem_ops)
# no custom implementation; falls thru to compiler # no custom implementation; falls thru to compiler
add_library(pico_mem_ops_compiler INTERFACE) pico_add_library(pico_mem_ops_compiler)
# add alias "default" which is just pico. # add alias "default" which is just pico.
add_library(pico_mem_ops_default INTERFACE) add_library(pico_mem_ops_default INTERFACE)

View File

@ -1,6 +1,6 @@
if (NOT TARGET pico_printf) if (NOT TARGET pico_printf)
# library to be depended on - we make this depend on particular implementations using per target generator expressions # library to be depended on - we make this depend on particular implementations using per target generator expressions
pico_add_library(pico_printf NOFLAG) pico_add_library(pico_printf)
# no custom implementation; falls thru to compiler # no custom implementation; falls thru to compiler
pico_add_library(pico_printf_compiler) pico_add_library(pico_printf_compiler)

View File

@ -1,4 +1,4 @@
pico_add_library(pico_runtime NOFLAG) pico_add_library(pico_runtime)
target_sources(pico_runtime INTERFACE target_sources(pico_runtime INTERFACE
${CMAKE_CURRENT_LIST_DIR}/runtime.c ${CMAKE_CURRENT_LIST_DIR}/runtime.c

View File

@ -1,5 +1,5 @@
if (NOT TARGET pico_standard_link) if (NOT TARGET pico_standard_link)
pico_add_library(pico_standard_link NOFLAG) pico_add_library(pico_standard_link)
target_sources(pico_standard_link INTERFACE target_sources(pico_standard_link INTERFACE
${CMAKE_CURRENT_LIST_DIR}/crt0.S ${CMAKE_CURRENT_LIST_DIR}/crt0.S

View File

@ -1,5 +1,5 @@
if (NOT TARGET pico_stdio) if (NOT TARGET pico_stdio)
pico_add_library(pico_stdio NOFLAG) pico_add_library(pico_stdio)
target_include_directories(pico_stdio_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include) target_include_directories(pico_stdio_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)

View File

@ -6,7 +6,7 @@ option(PICO_STDIO_USB "Globablly enable stdio USB" 0)
option(PICO_STDIO_SEMIHOSTING "Globablly enable stdio semihosting" 0) option(PICO_STDIO_SEMIHOSTING "Globablly enable stdio semihosting" 0)
if (NOT TARGET pico_stdlib) if (NOT TARGET pico_stdlib)
pico_add_impl_library(pico_stdlib NOFLAG) pico_add_impl_library(pico_stdlib)
target_sources(pico_stdlib INTERFACE target_sources(pico_stdlib INTERFACE
${CMAKE_CURRENT_LIST_DIR}/stdlib.c ${CMAKE_CURRENT_LIST_DIR}/stdlib.c
) )

View File

@ -1,4 +1,4 @@
pico_add_library(pico_unique_id NOFLAG) pico_add_library(pico_unique_id)
target_sources(pico_unique_id INTERFACE target_sources(pico_unique_id INTERFACE
${CMAKE_CURRENT_LIST_DIR}/unique_id.c ${CMAKE_CURRENT_LIST_DIR}/unique_id.c