example run well with cmake for imxrt

This commit is contained in:
hathach
2023-04-21 18:10:28 +07:00
parent 2ac289685a
commit 0afe1b3684
5 changed files with 74 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.17)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake)
@@ -27,37 +27,6 @@ target_include_directories(${PROJECT} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
)
if(FAMILY STREQUAL "rp2040")
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})
else ()
# TOP is absolute path to root directory of TinyUSB git repo
set(TOP "${CMAKE_CURRENT_LIST_DIR}/../../..")
get_filename_component(TOP "${TOP}" REALPATH)
# re-include family.cmake
include(${TOP}/hw/bsp/${FAMILY}/family.cmake)
target_sources(${PROJECT} PUBLIC
${TOP}/src/device/usbd.c
${TOP}/src/device/usbd_control.c
${TOP}/src/class/audio/audio_device.c
${TOP}/src/class/cdc/cdc_device.c
${TOP}/src/class/dfu/dfu_device.c
${TOP}/src/class/dfu/dfu_rt_device.c
${TOP}/src/class/hid/hid_device.c
${TOP}/src/class/midi/midi_device.c
${TOP}/src/class/msc/msc_device.c
${TOP}/src/class/net/ecm_rndis_device.c
${TOP}/src/class/net/ncm_device.c
${TOP}/src/class/usbtmc/usbtmc_device.c
${TOP}/src/class/vendor/vendor_device.c
${TOP}/src/class/video/video_device.c
)
target_include_directories(${PROJECT} PUBLIC
${TOP}/hw
${TOP}/src
)
endif ()
# Configure compilation flags and libraries for the example... see the corresponding function
# in hw/bsp/FAMILY/family.cmake for details.
family_configure_device_example(${PROJECT})