Allow users to specify @CURRENT_SOURCE_DIR@ in generator arguments to specify the current target source directory. This is useful when creating protobuf generator objects in sub-directories because protoc will then generate files in the expected location. Fixes #1622. Remove stray semicolon Update documentationpull/1610/head
parent
1882548f05
commit
ccab7d64f4
8 changed files with 31 additions and 0 deletions
@ -0,0 +1,3 @@ |
||||
message Dummy { |
||||
required string text = 1; |
||||
} |
@ -0,0 +1,9 @@ |
||||
#include "defs.pb.h" |
||||
|
||||
int main(int argc, char **argv) { |
||||
GOOGLE_PROTOBUF_VERIFY_VERSION; |
||||
Dummy *d = new Dummy; |
||||
delete d; |
||||
google::protobuf::ShutdownProtobufLibrary(); |
||||
return 0; |
||||
} |
@ -0,0 +1,8 @@ |
||||
subdirgen = generator(protoc, \ |
||||
output : ['@BASENAME@.pb.cc', '@BASENAME@.pb.h'], |
||||
arguments : ['--proto_path=@CURRENT_SOURCE_DIR@', '--cpp_out=@BUILD_DIR@', '@INPUT@']) |
||||
|
||||
generated = subdirgen.process('defs.proto') |
||||
e = executable('subdir-prog', 'main.cpp', generated, |
||||
dependencies : dep) |
||||
test('subdir-prototest', e) |
Loading…
Reference in new issue