Willy Tu | baa8d40 | 2021-12-07 19:44:31 -0800 | [diff] [blame^] | 1 | src_pb = custom_target( |
Jie Yang | b988dbb | 2021-08-06 18:34:49 -0700 | [diff] [blame] | 2 | 'proto', |
| 3 | command: [ |
| 4 | find_program('protoc', native: true), |
| 5 | '--proto_path=@CURRENT_SOURCE_DIR@', |
| 6 | '--cpp_out=@OUTDIR@', |
| 7 | '@INPUT@' |
| 8 | ], |
| 9 | output: [ |
| 10 | 'binaryblob.pb.cc', |
| 11 | 'binaryblob.pb.h', |
| 12 | ], |
| 13 | input: 'binaryblob.proto') |
Willy Tu | baa8d40 | 2021-12-07 19:44:31 -0800 | [diff] [blame^] | 14 | |
| 15 | binaryblobproto_pre = declare_dependency( |
| 16 | include_directories: include_directories('.'), |
| 17 | dependencies: dependency('protobuf') |
| 18 | ) |
| 19 | |
| 20 | binaryblobproto_lib = static_library( |
| 21 | 'binaryblob_proto', |
| 22 | src_pb, |
| 23 | implicit_include_directories: false, |
| 24 | dependencies: binaryblobproto_pre |
| 25 | ) |
| 26 | |
| 27 | binaryblobproto_dep = declare_dependency( |
| 28 | dependencies: binaryblobproto_pre, |
| 29 | link_with: binaryblobproto_lib |
| 30 | ) |