diff options
| author | hathach <[email protected]> | 2023-04-20 14:09:38 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-04-20 14:09:38 +0700 |
| commit | fab48e5bcc0708077a0efb6f2412b92a6529bc3e (patch) | |
| tree | 631b401b08413c90177f31d49897ea47074f3706 /examples | |
| parent | 9771c76f25d0c28612abb7afbd6202f7fe5e85c1 (diff) | |
adding cmake build for imxrt1010
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/device/board_test/CMakeLists.txt | 47 | ||||
| -rw-r--r-- | examples/device/cdc_msc/CMakeLists.txt | 2 |
2 files changed, 44 insertions, 5 deletions
diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt index 4435bd523..ac47bf0b4 100644 --- a/examples/device/board_test/CMakeLists.txt +++ b/examples/device/board_test/CMakeLists.txt @@ -1,4 +1,10 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) +include(CMakePrintHelpers) + +# default toolchain is gcc +if (NOT TOOLCHAIN) + set(TOOLCHAIN "gcc") +endif () include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake) @@ -24,7 +30,40 @@ if(NOT FAMILY STREQUAL "espressif") ${CMAKE_CURRENT_SOURCE_DIR}/src ) - # 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}) + 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 () endif() diff --git a/examples/device/cdc_msc/CMakeLists.txt b/examples/device/cdc_msc/CMakeLists.txt index 8e4db9d29..caac260d1 100644 --- a/examples/device/cdc_msc/CMakeLists.txt +++ b/examples/device/cdc_msc/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.13) include(${CMAKE_CURRENT_SOURCE_DIR}/../../../hw/bsp/family_support.cmake) |
