mirror of
https://github.com/google/pebble.git
synced 2025-06-20 00:00:36 +00:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
24
third_party/nanopb/tests/proto3_optional/SConscript
vendored
Normal file
24
third_party/nanopb/tests/proto3_optional/SConscript
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Test proto3 "optional" field types.
|
||||
# This is supported in protoc 3.12 and newer.
|
||||
|
||||
Import('env')
|
||||
import re
|
||||
|
||||
version = None
|
||||
if 'PROTOC_VERSION' in env:
|
||||
match = re.search('([0-9]+).([0-9]+).([0-9]+)', env['PROTOC_VERSION'])
|
||||
version = (int(match.group(1)), int(match.group(2)), int(match.group(3)))
|
||||
|
||||
# Oneof is supported by protoc >= 3.12.0
|
||||
if env.GetOption('clean') or (version and (version[0] > 3 or (version[0] == 3 and version[1] >= 12))):
|
||||
|
||||
env2 = env.Clone()
|
||||
env2.Append(PROTOCFLAGS = "--experimental_allow_proto3_optional")
|
||||
|
||||
env2.NanopbProto("optional.proto")
|
||||
opt = env2.Program(["optional.c", "optional.pb.c",
|
||||
"$COMMON/pb_decode.o", "$COMMON/pb_encode.o",
|
||||
"$COMMON/pb_common.o"])
|
||||
env2.RunTest(opt)
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue