Actually make the protoc version check work

This commit is contained in:
Petteri Aimonen
2015-01-04 20:20:40 +02:00
parent 7135e2797a
commit cc3c8732fd
2 changed files with 10 additions and 6 deletions

View File

@@ -3,10 +3,16 @@
Import('env')
import re
version = re.search('([0-9]+).([0-9]+).([0-9]+)', 'libprotoc 3.0.0').groups()
match = None
if 'PROTOC_VERSION' in env:
match = re.search('([0-9]+).([0-9]+).([0-9]+)', env['PROTOC_VERSION'])
if match:
version = map(int, match.groups())
# Oneof is supported by protoc >= 2.6.0
if int(version[0]) > 2 or (int(version[0]) == 2 and int(version[1]) >= 6):
if env.GetOption('clean') or (match and (version[0] > 2 or (version[0] == 2 and version[1] >= 6))):
env.NanopbProto('oneof')
enc = env.Program(['encode_oneof.c',