Files
pico-examples/hello_world/usb/CMakeLists.txt
2023-12-08 21:13:49 -06:00

22 lines
734 B
CMake

if (TARGET tinyusb_device)
add_executable(hello_usb
hello_usb.cpp
)
set(PICO_CXX_ENABLE_EXCEPTIONS 1)
# pull in common dependencies
target_link_libraries(hello_usb pico_stdlib pico_multicore pico_util)
target_compile_definitions(hello_usb PRIVATE PARAM_ASSERTIONS_ENABLE_ALL=1)
# enable usb output, disable uart output
pico_enable_stdio_usb(hello_usb 1)
pico_enable_stdio_uart(hello_usb 0)
# create map/bin/hex/uf2 file etc.
pico_add_extra_outputs(hello_usb)
# add url via pico_set_program_url
example_auto_set_url(hello_usb)
elseif(PICO_ON_DEVICE)
message(WARNING "not building hello_usb because TinyUSB submodule is not initialized in the SDK")
endif()