Actually make the protoc version check work
This commit is contained in:
@@ -73,11 +73,9 @@ if not env.GetOption('clean'):
|
|||||||
conf.env.Append(PROTOCPATH = '/usr/include')
|
conf.env.Append(PROTOCPATH = '/usr/include')
|
||||||
|
|
||||||
# Check protoc version
|
# Check protoc version
|
||||||
status, output = conf.TryAction('protoc --version')
|
status, output = conf.TryAction('$PROTOC --version > $TARGET')
|
||||||
if status:
|
if status:
|
||||||
conf.env.Append(PROTOC_VERSION = output)
|
conf.env['PROTOC_VERSION'] = output
|
||||||
else:
|
|
||||||
conf.env.Append(PROTOC_VERSION = "")
|
|
||||||
|
|
||||||
# Check if libmudflap is available (only with GCC)
|
# Check if libmudflap is available (only with GCC)
|
||||||
if 'gcc' in env['CC']:
|
if 'gcc' in env['CC']:
|
||||||
|
|||||||
@@ -3,10 +3,16 @@
|
|||||||
Import('env')
|
Import('env')
|
||||||
|
|
||||||
import re
|
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
|
# 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')
|
env.NanopbProto('oneof')
|
||||||
|
|
||||||
enc = env.Program(['encode_oneof.c',
|
enc = env.Program(['encode_oneof.c',
|
||||||
|
|||||||
Reference in New Issue
Block a user