summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-11 16:45:52 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2013-09-11 16:45:52 +0300
commit2b728150360f4c15512579ff53bc3247d3b8d083 (patch)
treedf1f770b697dfe0a05605e917dafd3b829eaa9a8
parent61ad04afd5236e2a6a0d4b4f2caa3bab4a820c99 (diff)
Fix build error when path contains spaces
-rw-r--r--tests/site_scons/site_init.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/site_scons/site_init.py b/tests/site_scons/site_init.py
index 86e50335..1f811153 100644
--- a/tests/site_scons/site_init.py
+++ b/tests/site_scons/site_init.py
@@ -37,7 +37,8 @@ def add_nanopb_builders(env):
src_suffix = '.pb',
emitter = nanopb_targets)
env.Append(BUILDERS = {'Nanopb': nanopb_file_builder})
- env.SetDefault(NANOPB_GENERATOR = 'python ' + env.GetBuildPath("#../generator/nanopb_generator.py"))
+ gen_path = env['ESCAPE'](env.GetBuildPath("#../generator/nanopb_generator.py"))
+ env.SetDefault(NANOPB_GENERATOR = 'python ' + gen_path)
env.SetDefault(NANOPB_FLAGS = '-q')
# Combined method to run both protoc and nanopb generator
@@ -71,8 +72,10 @@ def add_nanopb_builders(env):
# Build command that decodes a message using protoc
def decode_actions(source, target, env, for_signature):
- dirs = ' '.join(['-I' + env.GetBuildPath(d) for d in env['PROTOCPATH']])
- return '$PROTOC $PROTOCFLAGS %s --decode=%s %s <%s >%s' % (dirs, env['MESSAGE'], source[1], source[0], target[0])
+ esc = env['ESCAPE']
+ dirs = ' '.join(['-I' + esc(env.GetBuildPath(d)) for d in env['PROTOCPATH']])
+ return '$PROTOC $PROTOCFLAGS %s --decode=%s %s <%s >%s' % (
+ dirs, env['MESSAGE'], esc(str(source[1])), esc(str(source[0])), esc(str(target[0])))
decode_builder = Builder(generator = decode_actions,
suffix = '.decoded')