Protocol Buffers - Google's data interchange format (grpc依赖) https://developers.google.com/protocol-buffers/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
982 B

include(${protobuf_SOURCE_DIR}/src/file_lists.cmake)
set(bootstrap_cmake_dir ${protobuf_SOURCE_DIR}/upb_generator/cmake)
set(bootstrap_sources
${bootstrap_cmake_dir}/google/protobuf/compiler/plugin.upb.h
${bootstrap_cmake_dir}/google/protobuf/compiler/plugin.upb_minitable.h
${bootstrap_cmake_dir}/google/protobuf/compiler/plugin.upb_minitable.c
)
foreach(generator upb upbdefs upb_minitable)
add_executable(protoc-gen-${generator}
${protoc-gen-${generator}_srcs}
${protoc-gen-${generator}_hdrs}
${bootstrap_sources}
${protobuf_version_rc_file}
)
target_include_directories(protoc-gen-${generator} PRIVATE ${bootstrap_cmake_dir})
target_link_libraries(protoc-gen-${generator}
${protobuf_LIB_PROTOBUF}
${protobuf_LIB_UPB}
${protobuf_ABSL_USED_TARGETS}
)
set_target_properties(protoc-gen-${generator} PROPERTIES VERSION ${protobuf_VERSION})
add_executable(protobuf::protoc-gen-${generator} ALIAS protoc-gen-${generator})
endforeach()