def proto_library(name=None, srcs=[], deps=[], gen_cpp='', gen_py=''): if not name.endswith('_proto'): Util.Abort('proto lib\'s name should ends with "_proto"') if len(srcs) != 1 or not srcs[0].endswith('.proto'): Util.Abort('proto src should be only one .proto file') opt = {'gen_cpp': False, 'gen_py': False} if str(gen_cpp) == '1': opt['gen_cpp'] = True if str(gen_py) == '1': opt['gen_py'] = True RegisterObj(name, srcs, deps, opt, 'proto_library')
def thrift_library(name=None, srcs=[], deps=[], gen_cpp='', gen_php='', gen_py=''): if not name.endswith('_thrift'): Util.Abort('thrift lib\'s name should ends with "_thirft": %s' % name) if len(srcs) != 1 or not srcs[0].endswith('.thrift'): Util.Abort('thrift src should be only one .thrift file: %s' % str(srcs)) opt = {'gen_cpp': False, 'gen_php': False, 'gen_py': False} if str(gen_cpp) == '1': opt['gen_cpp'] = True if str(gen_php) == '1': opt['gen_php'] = True if str(gen_py) == '1': opt['gen_py'] = True RegisterObj(name, srcs, deps, opt, 'thrift_library')