Skip to content

Commit

Permalink
build: use protobuf::protoc for the path to protoc compiler
Browse files Browse the repository at this point in the history
and add it as a dependency for generating C++ bindings. simpler this
way. protobuf::protoc was added to FindProtobuf in CMake 3.10, and
our minimal required CMake version is 3.13, so we should be able to
have access to this variable as long as Protobuf is found.

Signed-off-by: Kefu Chai <kefu.chai@scylladb.com>
  • Loading branch information
tchaikov committed Mar 6, 2024
1 parent e679905 commit 47c7484
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,11 @@ function (seastar_generate_protobuf)
set (source_out ${args_OUT_DIR}/${in_file_name}.pb.cc)

add_custom_command (
DEPENDS ${args_IN_FILE}
DEPENDS ${args_IN_FILE} protobuf::protoc
OUTPUT ${header_out} ${source_out}
COMMAND ${CMAKE_COMMAND} -E make_directory ${args_OUT_DIR}
COMMAND ${Protobuf_PROTOC_EXECUTABLE} --cpp_out=${args_OUT_DIR} -I${in_file_dir} ${args_IN_FILE})
COMMAND protobuf::protoc
ARGS --cpp_out=${args_OUT_DIR} -I${in_file_dir} ${args_IN_FILE})

add_custom_target (${args_TARGET}
DEPENDS
Expand Down

0 comments on commit 47c7484

Please sign in to comment.