Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nanopb/nanopb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-11-25 16:14:34 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-11-25 16:14:34 +0300
commitb945553bb3bf5098c2cb6260f113c53158937442 (patch)
tree528e0497793274ef3bc1529aa1afd5d27d8bc83a
parent8350d4b23ea1fb6050aaee5247bdbcdc6521482b (diff)
Test case runner: fix passing of spaces in NANOPBFLAGS
-rw-r--r--tests/site_scons/site_tools/nanopb.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/site_scons/site_tools/nanopb.py b/tests/site_scons/site_tools/nanopb.py
index 4abf02a..6b82ce4 100644
--- a/tests/site_scons/site_tools/nanopb.py
+++ b/tests/site_scons/site_tools/nanopb.py
@@ -144,15 +144,12 @@ def _nanopb_proto_actions(source, target, env, for_signature):
include_dirs += ' -I' + esc(d)
# when generating .pb.cpp sources, instead of pb.h generate .pb.hpp headers
- source_extension = os.path.splitext(str(target[0]))[1]
- header_extension = '.h' + source_extension[2:]
nanopb_flags = env['NANOPBFLAGS']
- if nanopb_flags:
- nanopb_flags = '--source-extension=%s,--header-extension=%s,%s:.' % (source_extension, header_extension, nanopb_flags)
- else:
- nanopb_flags = '--source-extension=%s,--header-extension=%s:.' % (source_extension, header_extension)
+ source_extension = os.path.splitext(str(target[0]))[1]
+ if source_extension == '.cpp':
+ nanopb_flags += ',--source-extension=.cpp,--header-extension=.hpp'
- return SCons.Action.CommandAction('$PROTOC $PROTOCFLAGS %s --nanopb_out=%s %s' % (include_dirs, nanopb_flags, srcfile),
+ return SCons.Action.CommandAction('$PROTOC $PROTOCFLAGS %s --nanopb_out=. "--nanopb_opt=%s" %s' % (include_dirs, nanopb_flags, srcfile),
chdir = prefix)
def _nanopb_proto_emitter(target, source, env):