Start of 5.X work

This commit is contained in:
Sebastien L
2025-03-18 17:38:34 -04:00
parent c0ddf0a997
commit 73bd096f37
442 changed files with 227862 additions and 21075 deletions

View File

@@ -1,6 +1,6 @@
# Append nanopb path to CMAKE_MODULE_PATH for finding the nanopb package
cmake_minimum_required(VERSION 3.16)
include(../protobuf_utils.cmake)
include(../../tools/protoc_utils/protobuf_utils.cmake)
configure_env()
file(GLOB_RECURSE PROTO_FILES *.proto)
@@ -10,20 +10,19 @@ nanopb_generate_cpp(PROTO_SRCS PROTO_HDRS RELPATH ${CMAKE_CURRENT_SOURCE_DIR} ${
# Create a custom target to generate the proto files
set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE)
add_custom_target(generate_system_proto DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
add_custom_target(generate_system_proto ALL DEPENDS ${PROTO_SRCS} ${PROTO_HDRS})
add_library(platform_protobuf STATIC ${PROTO_SRCS} ${PROTO_HDRS})
# PUBLIC to propagate includes from bell to cspot dependents
target_compile_definitions(platform_protobuf PUBLIC PB_ENABLE_MALLOC)
target_compile_definitions(platform_protobuf PUBLIC PB_FIELD_32BIT)
add_dependencies(platform_protobuf generate_system_proto)
# target_compile_definitions(platform_protobuf PUBLIC PB_ENABLE_MALLOC PB_FIELD_32BIT)
# target_compile_definitions(__idf_tools PUBLIC PB_ENABLE_MALLOC PB_FIELD_32BIT)
target_include_directories(platform_protobuf PUBLIC "include" ${CMAKE_CURRENT_BINARY_DIR} ${NANOPB_INCLUDE_DIRS} ${EXTRA_INCLUDES})
# Link the generated proto library to your main targets
target_link_libraries(__idf_platform_config PRIVATE platform_protobuf)
target_link_libraries(__idf_wifi-manager PRIVATE platform_protobuf)
target_include_directories(__idf_platform_config PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/proto)