-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbflbsdk.cmake
53 lines (45 loc) · 1.24 KB
/
bflbsdk.cmake
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
cmake_minimum_required(VERSION 3.15)
include(proj.conf OPTIONAL RESULT_VARIABLE proj_conf_file)
if(CONFIG_BFLB_BOARD)
set(BOARD ${CONFIG_BFLB_BOARD})
endif()
if(CONFIG_BFLB_CHIP)
set(CHIP ${CONFIG_BFLB_CHIP})
endif()
if(CONFIG_BFLB_CPU_ID)
set(CPU_ID ${CONFIG_BFLB_CPU_ID})
endif()
if(BOARD STREQUAL "ox64")
set(CHIP "bl808")
elseif(BOARD STREQUAL "m1sdock")
set(CHIP "bl808")
elseif(BOARD STREQUAL "bl808dk")
set(CHIP "bl808")
unset(BOARD_DIR CACHE)
elseif(BOARD STREQUAL "m0sdock")
set(CHIP "bl616")
elseif(BOARD STREQUAL "bl616dk")
set(CHIP "bl616")
unset(BOARD_DIR CACHE)
elseif(BOARD STREQUAL "m0sense")
set(CHIP "bl702")
endif()
if(CHIP STREQUAL "bl808")
if(NOT CPU_ID)
set(CPU_ID "m0")
endif()
endif()
if(CPU_ID)
message(STATUS "BOARD: ${BOARD}, CHIP: ${CHIP}, CPU_ID: ${CPU_ID}")
else()
message(STATUS "BOARD: ${BOARD}, CHIP: ${CHIP}")
endif()
if(BOARD_DIR)
message(STATUS "BOARD_DIR: ${BOARD_DIR}")
endif()
find_package(bouffalo_sdk REQUIRED HINTS $ENV{BL_SDK_BASE})
include(${SDK_PATH}/cmake/sdk.cmake)
include(${SDK_PATH}/cmake/kconfig.cmake)
include(${SDK_PATH}/cmake/flash.cmake)
add_subdirectory(${SDK_PATH}/bsp/common/ bsp_common)
add_subdirectory(${SDK_PATH}/components/ components)