-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
63 lines (57 loc) · 3.8 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cmake_minimum_required(VERSION 3.15)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/hid)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/cdc)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/msc)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/dfu)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/common)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/core)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/port/${USBIP})
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/core)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/${CHIP_FAMILY}/${BL_TYPE})
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/${CHIP_FAMILY})
# USB source
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/core/usbd_core.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/port/${USBIP}/${USB_DCD})
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/msc/usbd_msc.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/hid/usbd_hid.c)
if(${BL_TYPE} STREQUAL "dfu")
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/CherryUSB/class/dfu/usbd_dfu.c)
endif()
# Bootloader source
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/src/core/*.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/src/port/common/${BL_TYPE}/*.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/src/port/${CHIP_FAMILY}/*.c)
if(USE_MCU_BOOT)
# MCU Boot
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/mcuboot/ext/mbedtls/include)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/mcuboot/ext/mbedtls/library)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/flash_map_backend)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/mcuboot_config)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/os)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/sysflash)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/mbedtls)
sdk_add_compile_definitions(MBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/mbedtls/mbedtls_config.h")
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/ext/mbedtls/library/[^x509]*.c)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/include)
sdk_append_inc(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/include/bootutil)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/boot_record.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/bootutil_misc.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/bootutil_public.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/caps.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/encrypted.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/fault_injection_hardening.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/fault_injection_hardening_delay_rng_mbedtls.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/image_ec.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/image_ec256.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/image_ed25519.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/image_rsa.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/image_validate.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/loader.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/swap_misc.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/swap_move.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/swap_scratch.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/mcuboot/boot/bootutil/src/tlv.c)
sdk_append_source(${CMAKE_CURRENT_LIST_DIR}/src/port/common/mcu_boot/mcu_boot.c)
endif()
add_subdirectory(drv)