diff --git a/CMakeLists.txt b/CMakeLists.txt index 5258d95..03043d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,6 +114,7 @@ add_module(log library/log OFF OFF) add_module(common library/common ON OFF) add_module(list library/list OFF OFF) add_module(ringbuffer library/ringbuffer OFF OFF) +add_module(protobuf library/protobuf OFF OFF) add_module(peripheral peripheral OFF ON) add_module(littlefs library/littlefs OFF OFF) add_module(lua lua OFF ON) diff --git a/RBcore/CMakeLists.txt b/RBcore/CMakeLists.txt index 632e82d..43b5bd5 100644 --- a/RBcore/CMakeLists.txt +++ b/RBcore/CMakeLists.txt @@ -15,6 +15,12 @@ else() message(FATAL_ERROR "[${TARGET_NAME}] Dependency 'bspMCU' not found.") endif() +if(TARGET protobuf) + target_link_libraries(${TARGET_NAME} PUBLIC protobuf) +else() + message(FATAL_ERROR "[${TARGET_NAME}] Dependency 'protobuf' not found.") +endif() + get_filename_component(ROBOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." ABSOLUTE) file(GLOB PROJECT_DIRS LIST_DIRECTORIES true "${ROBOT_DIR}/project/*") foreach(PROJ_DIR ${PROJECT_DIRS}) diff --git a/library/protobuf/CMakeLists.txt b/library/protobuf/CMakeLists.txt new file mode 100644 index 0000000..bc2429e --- /dev/null +++ b/library/protobuf/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.10) + +set(COMMON_CMAKE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt") + +if(EXISTS ${COMMON_CMAKE_PATH}) + include(${COMMON_CMAKE_PATH}) +else() + message(FATAL_ERROR "Cannot find common build logic at ${COMMON_CMAKE_PATH}") +endif() + +if(TARGET common) + target_link_libraries(${TARGET_NAME} PUBLIC common) +else() + message(FATAL_ERROR "[${TARGET_NAME}] Dependency 'common' not found.") +endif() diff --git a/RBcore/include/pb.h b/library/protobuf/include/pb.h similarity index 100% rename from RBcore/include/pb.h rename to library/protobuf/include/pb.h diff --git a/RBcore/include/pb_common.h b/library/protobuf/include/pb_common.h similarity index 100% rename from RBcore/include/pb_common.h rename to library/protobuf/include/pb_common.h diff --git a/RBcore/include/pb_decode.h b/library/protobuf/include/pb_decode.h similarity index 100% rename from RBcore/include/pb_decode.h rename to library/protobuf/include/pb_decode.h diff --git a/RBcore/include/pb_encode.h b/library/protobuf/include/pb_encode.h similarity index 100% rename from RBcore/include/pb_encode.h rename to library/protobuf/include/pb_encode.h diff --git a/RBcore/pb_common.c b/library/protobuf/pb_common.c similarity index 100% rename from RBcore/pb_common.c rename to library/protobuf/pb_common.c diff --git a/RBcore/pb_decode.c b/library/protobuf/pb_decode.c similarity index 100% rename from RBcore/pb_decode.c rename to library/protobuf/pb_decode.c diff --git a/RBcore/pb_encode.c b/library/protobuf/pb_encode.c similarity index 100% rename from RBcore/pb_encode.c rename to library/protobuf/pb_encode.c diff --git a/project b/project index bb250aa..3cedc44 160000 --- a/project +++ b/project @@ -1 +1 @@ -Subproject commit bb250aa22b82811f6f752bb266d19092e6a78b61 +Subproject commit 3cedc4451e7bdcb0a18bb3042c84e8db581b43ca