Skip to content

Commit

Permalink
[refact][third-party]: Change proto path
Browse files Browse the repository at this point in the history
  • Loading branch information
chuandew authored and ketor committed Jan 2, 2025
1 parent a812902 commit cd6453f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "dingofs/proto"]
path = dingofs/proto
path = proto
url = https://github.com/dingodb/dingofs-proto.git
15 changes: 6 additions & 9 deletions dingofs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,15 @@



set(PROTO_OUTPUT_DIR ${CMAKE_BINARY_DIR}/protos)
include_directories(${CMAKE_BINARY_DIR}/protos)

set(PROTO_OUTPUT_DIR ${CMAKE_BINARY_DIR}/protos/dingofs/proto)
add_custom_target(create_proto_output_dir ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROTO_OUTPUT_DIR}
)
message("PROTO_OUTPUT_DIR:${PROTO_OUTPUT_DIR}")

include_directories(${PROTO_OUTPUT_DIR})

set(PROTO_OBJS_SRC "")


set(PROTOS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/proto)
set(PROTOS_DIR ${PROJECT_SOURCE_DIR}/proto)
message("PROTOS_DIR:${PROTOS_DIR}")
file(GLOB_RECURSE MSG_PROTOS ${PROTOS_DIR}/*.proto)

Expand All @@ -37,7 +34,7 @@ foreach(msg ${MSG_PROTOS})

message(STATUS "proto file: ${msg}")

set(FILE_PREFIX_NAME "${PROTO_OUTPUT_DIR}/dingofs/proto/${FIL_WE}")
set(FILE_PREFIX_NAME "${PROTO_OUTPUT_DIR}/${FIL_WE}")
message(STATUS "FILE_PREFIX_NAME: ${FILE_PREFIX_NAME}")
list(APPEND PROTO_SRCS "${FILE_PREFIX_NAME}.pb.cc")
list(APPEND PROTO_HDRS "${FILE_PREFIX_NAME}.pb.h")
Expand All @@ -47,7 +44,7 @@ foreach(msg ${MSG_PROTOS})
"${FILE_PREFIX_NAME}.pb.h"
COMMAND ${PROTOC}
ARGS --cpp_out ${PROTO_OUTPUT_DIR}
ARGS --proto_path=${PROJECT_SOURCE_DIR}
ARGS --proto_path=${PROTOS_DIR}
${msg}
DEPENDS ${msg}
COMMENT "Running C++ protocol buffer compiler on ${msg}"
Expand Down
1 change: 0 additions & 1 deletion dingofs/proto
Submodule proto deleted from b2383b
1 change: 1 addition & 0 deletions proto
Submodule proto added at b560eb

0 comments on commit cd6453f

Please sign in to comment.