bolar_1 date 2026-7-1 d:/proc
This commit is contained in:
41
CMakeLists.txt
Normal file
41
CMakeLists.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"components/esp-opus"
|
||||
"components/esp-opus-encoder"
|
||||
"components/esp-wifi-connect"
|
||||
"components/esp-ml307"
|
||||
)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
|
||||
set(PROJECT_VER "1.1.4.12")
|
||||
project(borla-firmware VERSION ${PROJECT_VER})
|
||||
|
||||
# Inject custom wake word model into esp-sr's srmodels.bin
|
||||
# movemodel.py clears srmodels/ then packs → we copy model after and repack in-place
|
||||
idf_build_get_property(build_dir BUILD_DIR)
|
||||
set(pack_model_py ${CMAKE_SOURCE_DIR}/managed_components/espressif__esp-sr/model/pack_model.py)
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT ${build_dir}/srmodels/.custom_done
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_SOURCE_DIR}/model_data/wn9l_ni3hao3bo1le4
|
||||
${build_dir}/srmodels/wn9l_ni3hao3bo1le4
|
||||
COMMAND python ${pack_model_py} -m ${build_dir}/srmodels -o srmodels.bin
|
||||
COMMAND ${CMAKE_COMMAND} -E touch ${build_dir}/srmodels/.custom_done
|
||||
COMMENT "Injecting custom wake word model (你好播乐)..."
|
||||
DEPENDS ${build_dir}/srmodels/srmodels.bin
|
||||
WORKING_DIRECTORY ${build_dir}/srmodels
|
||||
)
|
||||
add_custom_target(custom_wakeword ALL DEPENDS ${build_dir}/srmodels/.custom_done)
|
||||
add_dependencies(custom_wakeword srmodels_bin)
|
||||
add_dependencies(flash custom_wakeword)
|
||||
|
||||
# 禁止部分编译器警告
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Wno-missing-field-initializers" APPEND)
|
||||
|
||||
# Fix NimBLE compilation with GCC 13 (ESP-IDF v5.3.2 known issue)
|
||||
idf_build_set_property(COMPILE_OPTIONS "-Wno-error=implicit-function-declaration;-Wno-error=array-bounds" APPEND)
|
||||
set(CMAKE_GENERATOR "Unix Makefiles" CACHE INTERNAL "" FORCE)
|
||||
set(CMAKE_MAKE_PROGRAM "make" CACHE INTERNAL "" FORCE)
|
||||
Reference in New Issue
Block a user