make all non hardware_ libraries foo add C preprocessor definition LIB_FOO=1, and remove bespoke definitions which were all undocumented anyway (#374)

This commit is contained in:
Graham Sanderson
2021-05-04 08:00:17 -05:00
committed by GitHub
parent 6796faf0d5
commit b7da70a53b
46 changed files with 114 additions and 183 deletions

View File

@ -73,14 +73,13 @@ if (EXISTS ${PICO_TINYUSB_PATH}/${TINYUSB_TEST_PATH})
# unmarked version used by stdio USB
target_link_libraries(tinyusb_device_unmarked INTERFACE tinyusb_common pico_fix_rp2040_usb_device_enumeration)
add_library(tinyusb_device INTERFACE)
pico_add_impl_library(tinyusb_device)
target_link_libraries(tinyusb_device INTERFACE tinyusb_device_unmarked)
target_compile_definitions(tinyusb_device INTERFACE
RP2040_USB_DEVICE_MODE=1
TINYUSB_DEVICE_LINKED=1
RP2040_USB_DEVICE_MODE=1 #define is used by tinyusb still
)
add_library(tinyusb_host INTERFACE)
pico_add_impl_library(tinyusb_host)
target_sources(tinyusb_host INTERFACE
${PICO_TINYUSB_PATH}/src/portable/raspberrypi/rp2040/hcd_rp2040.c
${PICO_TINYUSB_PATH}/src/portable/raspberrypi/rp2040/rp2040_usb.c
@ -96,13 +95,12 @@ if (EXISTS ${PICO_TINYUSB_PATH}/${TINYUSB_TEST_PATH})
# Sometimes have to do host specific actions in mostly
# common functions
target_compile_definitions(tinyusb_host INTERFACE
RP2040_USB_HOST_MODE=1
TINYUSB_HOST_LINKED=1
RP2040_USB_HOST_MODE=1 #define is used by tinyusb still
)
target_link_libraries(tinyusb_host INTERFACE tinyusb_common)
add_library(tinyusb_board INTERFACE)
pico_add_impl_library(tinyusb_board)
target_sources(tinyusb_board INTERFACE
${PICO_TINYUSB_PATH}/hw/bsp/raspberry_pi_pico/board_raspberry_pi_pico.c
)