Source generator now works with Protocol Buffers.

pull/15/head
Jussi Pakkanen 12 years ago
parent c9cb49764b
commit 3872cd024e
  1. 4
      backends.py
  2. 5
      test cases/frameworks/5 protocol buffers/main.cpp
  3. 3
      test cases/frameworks/5 protocol buffers/meson.build

@ -531,11 +531,11 @@ class NinjaBackend(Backend):
exe_file = exe.get_command()
base_args = generator.get_arglist()
for i in range(len(infilelist)):
infilename = os.path.join(self.build_to_src, infilelist[i])
infilename = os.path.join(self.environment.get_source_dir(), infilelist[i])
outfilename = os.path.join(self.get_target_private_dir(target), outfilelist[i])
args = [x.replace("@INPUT@", infilename).replace('@OUTPUT@', outfilename)\
for x in base_args]
args = [x.replace("@SOURCE_DIR@", self.environment.get_source_dir()).replace("@BUILD_DIR@", self.environment.get_build_dir())
args = [x.replace("@SOURCE_DIR@", self.environment.get_source_dir()).replace("@BUILD_DIR@", self.get_target_private_dir(target))
for x in args]
cmdlist = [exe_file] + args
elem = NinjaBuildElement(outfilename, 'CUSTOM_COMMAND', infilename)

@ -1,6 +1,9 @@
#include "defs.pb.h"
int main(int argc, char **argv) {
Dummy d;
GOOGLE_PROTOBUF_VERIFY_VERSION;
Dummy *d = new Dummy;
delete d;
google::protobuf::ShutdownProtobufLibrary();
return 0;
}

@ -9,6 +9,5 @@ gen = generator(protoc, \
generated = gen.process('defs.proto')
e = executable('prog', 'main.cpp', generated,
include_dirs: include_directories('.'),
dep : dep)
deps : dep)
add_test('prototest', e)

Loading…
Cancel
Save