blob: d5feb5af95c5bceff2a4186ca9522710f2eb3a5d [file] [log] [blame]
akmhoquefa8ee9b2014-03-14 09:06:24 -05001#! /usr/bin/env python
2# encoding: utf-8
3# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
5from waflib.Task import Task
6from waflib.TaskGen import extension
7class protoc(Task):
8 run_str='${PROTOC} ${PROTOC_FLAGS} ${PROTOC_ST:INCPATHS} ${SRC[0].abspath()}'
9 color='BLUE'
10 ext_out=['.h','pb.cc']
11@extension('.proto')
12def process_protoc(self,node):
13 cpp_node=node.change_ext('.pb.cc')
14 hpp_node=node.change_ext('.pb.h')
15 self.create_task('protoc',node,[cpp_node,hpp_node])
16 self.source.append(cpp_node)
17 if'cxx'in self.features and not self.env.PROTOC_FLAGS:
18 self.env.PROTOC_FLAGS='--cpp_out=%s'%node.parent.get_bld().abspath()
19 use=getattr(self,'use','')
20 if not'PROTOBUF'in use:
21 self.use=self.to_list(use)+['PROTOBUF']
22def configure(conf):
23 conf.check_cfg(package="protobuf",uselib_store="PROTOBUF",args=['--cflags','--libs'])
24 conf.find_program('protoc',var='PROTOC')
25 conf.env.PROTOC_ST='-I%s'