• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1include(${protobuf_SOURCE_DIR}/src/file_lists.cmake)
2
3set(bootstrap_cmake_dir ${protobuf_SOURCE_DIR}/upb_generator/cmake)
4set(bootstrap_sources
5  ${bootstrap_cmake_dir}/google/protobuf/compiler/plugin.upb.h
6  ${bootstrap_cmake_dir}/google/protobuf/compiler/plugin.upb_minitable.h
7  ${bootstrap_cmake_dir}/google/protobuf/compiler/plugin.upb_minitable.c
8)
9
10foreach(generator upb upbdefs upb_minitable)
11  add_executable(protoc-gen-${generator}
12    ${protoc-gen-${generator}_srcs}
13    ${protoc-gen-${generator}_hdrs}
14    ${bootstrap_sources}
15    ${protobuf_version_rc_file}
16  )
17  target_include_directories(protoc-gen-${generator} PRIVATE ${bootstrap_cmake_dir})
18  target_link_libraries(protoc-gen-${generator}
19    ${protobuf_LIB_UPB}
20    ${protobuf_ABSL_USED_TARGETS}
21  )
22  set_target_properties(protoc-gen-${generator} PROPERTIES VERSION ${protobuf_VERSION})
23  add_executable(protobuf::protoc-gen-${generator} ALIAS protoc-gen-${generator})
24endforeach()
25