2023-05-07 17:09:08 +02:00
|
|
|
cmake_minimum_required(VERSION 3.17)
|
2022-02-23 03:10:09 +01:00
|
|
|
|
|
|
|
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
|
|
|
|
|
|
|
|
# gets PROJECT name for the example (e.g. <BOARD>-<DIR_NAME>)
|
|
|
|
family_get_project_name(PROJECT ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
|
2023-05-07 17:09:08 +02:00
|
|
|
project(${PROJECT} C CXX ASM)
|
2022-02-23 03:10:09 +01:00
|
|
|
|
|
|
|
# Checks this example is valid for the family and initializes the project
|
|
|
|
family_initialize_project(${PROJECT} ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
|
|
|
|
add_executable(${PROJECT})
|
|
|
|
|
|
|
|
# Example source
|
|
|
|
target_sources(${PROJECT} PUBLIC
|
2023-05-10 06:15:11 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/usb_descriptors.c
|
|
|
|
)
|
2022-02-23 03:10:09 +01:00
|
|
|
|
|
|
|
# Example include
|
|
|
|
target_include_directories(${PROJECT} PUBLIC
|
2023-05-10 06:15:11 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
|
|
)
|
2022-02-23 03:10:09 +01:00
|
|
|
|
2023-06-27 10:45:38 +02:00
|
|
|
# Configure compilation flags and libraries for the example without RTOS.
|
|
|
|
# See the corresponding function in hw/bsp/FAMILY/family.cmake for details.
|
|
|
|
family_configure_dual_usb_example(${PROJECT} noos)
|
2022-06-27 12:53:42 +02:00
|
|
|
|
2022-11-21 06:28:33 +01:00
|
|
|
# due to warnings from Pico-PIO-USB
|
2022-06-27 12:53:42 +02:00
|
|
|
target_compile_options(${PROJECT} PUBLIC
|
2023-05-10 06:15:11 +02:00
|
|
|
-Wno-error=shadow
|
|
|
|
-Wno-error=cast-align
|
|
|
|
-Wno-error=cast-qual
|
|
|
|
-Wno-error=redundant-decls
|
|
|
|
-Wno-error=sign-conversion
|
|
|
|
-Wno-error=conversion
|
|
|
|
-Wno-error=sign-compare
|
|
|
|
-Wno-error=unused-function
|
|
|
|
)
|