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:34:25 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2022-11-25 16:34:25 +0300
commiteb135da5d4c6fce4f34ee6fcc5f13c741dbb042a (patch)
tree71d02fb66c92948157ac29215e98679e4faf16d2
parenta0d5beac3101c017199efa8b0805164ce7ce5e09 (diff)
Revert "Test case runner: fix passing of spaces in NANOPBFLAGS"
This reverts commit b945553bb3bf5098c2cb6260f113c53158937442. --nanopb_opt isn't compatible with protoc 3.0, which is still being supported and covered by CI tests.
-rw-r--r--tests/site_scons/site_tools/nanopb.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/site_scons/site_tools/nanopb.py b/tests/site_scons/site_tools/nanopb.py
index 6b82ce4..4abf02a 100644
--- a/tests/site_scons/site_tools/nanopb.py
+++ b/tests/site_scons/site_tools/nanopb.py
@@ -144,12 +144,15 @@ 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
- nanopb_flags = env['NANOPBFLAGS']
source_extension = os.path.splitext(str(target[0]))[1]
- if source_extension == '.cpp':
- nanopb_flags += ',--source-extension=.cpp,--header-extension=.hpp'
+ 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)
- return SCons.Action.CommandAction('$PROTOC $PROTOCFLAGS %s --nanopb_out=. "--nanopb_opt=%s" %s' % (include_dirs, nanopb_flags, srcfile),
+ return SCons.Action.CommandAction('$PROTOC $PROTOCFLAGS %s --nanopb_out=%s %s' % (include_dirs, nanopb_flags, srcfile),
chdir = prefix)
def _nanopb_proto_emitter(target, source, env):