diff options
author | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2015-01-04 20:20:40 +0200 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2015-01-04 20:20:40 +0200 |
commit | cc3c8732fd3f8505f46802dd54bd4a21c79b72aa (patch) | |
tree | 921002e19cb4f3afa19eda0332ef78e90b9c2c5e /tests/oneof | |
parent | 7135e2797a80f224541080117313088273f02cad (diff) |
Actually make the protoc version check work
Diffstat (limited to 'tests/oneof')
-rw-r--r-- | tests/oneof/SConscript | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/oneof/SConscript b/tests/oneof/SConscript index 95f451cb..22634fb0 100644 --- a/tests/oneof/SConscript +++ b/tests/oneof/SConscript @@ -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', |