Skip to content

Commit

Permalink
Merge pull request #1 from shiliu-yang/develop
Browse files Browse the repository at this point in the history
fix: update CMakeLists.txt for board configuration and library inclusion
  • Loading branch information
shiliu-yang authored Dec 10, 2024
2 parents 91f8482 + e8dc86b commit fbe1acc
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ get_filename_component(MODULE_NAME ${MODULE_PATH} NAME)
if(NOT DEFINED CONFIG_ARDUINO_BOARD)
message(FATAL_ERROR "Use [menuconfig] choice [ARDUINO_BOARD].")
endif()
if(${CONFIG_ARDUINO_BOARD} STREQUAL "ARDUINO_TUYA_T3")
if(${CONFIG_ARDUINO_BOARD} STREQUAL "ARDUINO_T3")
set(ARDUINO_BOARD "t3")
set(LD_FILE "${MODULE_PATH}/port/${PLATFORM_NAME}/bk7236_out.ld")
else()
set(CONFIG_ARDUINO_BOARD "ARDUINO_TUYA_T2")
set(CONFIG_ARDUINO_BOARD "ARDUINO_T2")
set(ARDUINO_BOARD "t2")
set(LD_FILE "${MODULE_PATH}/port/${PLATFORM_NAME}/bk7231n_ota.ld")
endif()

# LIB_SRCS
Expand All @@ -31,12 +29,26 @@ file(GLOB_RECURSE
)
file(GLOB_RECURSE
LIB_SRCS_LIB
"${MODULE_PATH}/libraries/BLE/src/*.cpp"
"${MODULE_PATH}/libraries/BLE/src/*.c"
"${MODULE_PATH}/libraries/FS/src/*.cpp"
"${MODULE_PATH}/libraries/FS/src/*.c"
"${MODULE_PATH}/libraries/HTTPClient/src/*.cpp"
"${MODULE_PATH}/libraries/HTTPClient/src/*.c"
"${MODULE_PATH}/libraries/LittleFS/src/*.cpp"
"${MODULE_PATH}/libraries/LittleFS/src/*.c"
"${MODULE_PATH}/libraries/Log/src/*.cpp"
"${MODULE_PATH}/libraries/Log/src/*.c"
"${MODULE_PATH}/libraries/MQTTClient/src/*.cpp"
"${MODULE_PATH}/libraries/MQTTClient/src/*.c"
"${MODULE_PATH}/libraries/SPI/src/*.cpp"
"${MODULE_PATH}/libraries/SPI/src/*.c"
"${MODULE_PATH}/libraries/Ticker/src/*.cpp"
"${MODULE_PATH}/libraries/Ticker/src/*.c"
"${MODULE_PATH}/libraries/TuyaIoT/src/*.cpp"
"${MODULE_PATH}/libraries/TuyaIoT/src/*.c"
)

file(GLOB_RECURSE
LIB_SRCS_VAR
"${MODULE_PATH}/variants/${ARDUINO_BOARD}/*.c"
Expand All @@ -45,15 +57,24 @@ list(APPEND LIB_SRCS ${LIB_SRCS_CORE})
list(APPEND LIB_SRCS ${LIB_SRCS_LIB})
list(APPEND LIB_SRCS ${LIB_SRCS_VAR})

# LIB_PUBLIC_INC
set(LIBRARIES_INC
"${MODULE_PATH}/libraries/BLE/src/"
"${MODULE_PATH}/libraries/FS/src/"
"${MODULE_PATH}/libraries/HTTPClient/src/"
"${MODULE_PATH}/libraries/LittleFS/src/"
"${MODULE_PATH}/libraries/Log/src/"
"${MODULE_PATH}/libraries/MQTTClient/src/"
"${MODULE_PATH}/libraries/SPI/src/"
"${MODULE_PATH}/libraries/Ticker/src/"
"${MODULE_PATH}/libraries/TuyaIoT/src/"
)

set(LIB_PUBLIC_INC
"${MODULE_PATH}/cores/tuya_open"
"${LIBRARIES_INC}"
"${MODULE_PATH}/variants/${ARDUINO_BOARD}"
)

# FLAGS
set(CMAKE_CXX_FLAGS "@${MODULE_PATH}/port/${PLATFORM_NAME}/flags/cpp_flags.txt")

########################################
# Target Configure
########################################
Expand Down

0 comments on commit fbe1acc

Please sign in to comment.