Lines Matching refs:env
40 def _detect_nanopb(env): argument
42 if env.has_key('NANOPB'):
44 return env['NANOPB']
54 def _detect_protoc(env): argument
56 if env.has_key('PROTOC'):
58 return env['PROTOC']
60 n = _detect_nanopb(env)
61 p1 = os.path.join(n, 'generator-bin', 'protoc' + env['PROGSUFFIX'])
64 return env['ESCAPE'](p1)
66 p = env.WhereIs('protoc')
69 return env['ESCAPE'](p)
74 def _detect_protocflags(env): argument
76 if env.has_key('PROTOCFLAGS'):
77 return env['PROTOCFLAGS']
79 p = _detect_protoc(env)
80 n = _detect_nanopb(env)
81 p1 = os.path.join(n, 'generator-bin', 'protoc' + env['PROGSUFFIX'])
82 if p == env['ESCAPE'](p1):
86 e = env['ESCAPE']
87 if env['PLATFORM'] == 'win32':
92 def _nanopb_proto_actions(source, target, env, for_signature): argument
93 esc = env['ESCAPE']
94 dirs = ' '.join(['-I' + esc(env.GetBuildPath(d)) for d in env['PROTOCPATH']])
97 def _nanopb_proto_emitter(target, source, env): argument
112 def generate(env): argument
115 env['NANOPB'] = _detect_nanopb(env)
116 env['PROTOC'] = _detect_protoc(env)
117 env['PROTOCFLAGS'] = _detect_protocflags(env)
119 env.SetDefault(PROTOCPATH = ['.', os.path.join(env['NANOPB'], 'generator', 'proto')])
121 env.SetDefault(NANOPB_PROTO_CMD = '$PROTOC $PROTOCFLAGS --nanopb_out=. $SOURCES')
122 env['BUILDERS']['NanopbProto'] = _nanopb_proto_builder
124 def exists(env): argument
125 return _detect_protoc(env) and _detect_protoc_opts(env)