Moved quoting function.

pull/15/head
Jussi Pakkanen 12 years ago
parent 016b9093d7
commit 5e51c526a1
  1. 3
      environment.py
  2. 7
      shellgenerator.py
  3. 1
      test cases/1 trivial/builder.txt
  4. 3
      test cases/1 trivial/trivial.c

@ -78,9 +78,6 @@ class GnuCCompiler(CCompiler):
def get_std_opt_flags(self):
return GnuCCompiler.std_opt_flags
def shell_quote(cmdlist):
return ["'" + x + "'" for x in cmdlist]
class Environment():
def __init__(self, source_dir, build_dir):
self.source_dir = source_dir

@ -16,6 +16,9 @@
import os, stat
def shell_quote(cmdlist):
return ["'" + x + "'" for x in cmdlist]
class ShellGenerator():
def __init__(self, interpreter, environment):
@ -57,7 +60,7 @@ class ShellGenerator():
commands.append(abs_src)
commands += compiler.get_output_flags()
commands.append(abs_obj)
quoted = environment.shell_quote(commands)
quoted = shell_quote(commands)
outfile.write('\necho Compiling \\"%s\\"\n' % src)
outfile.write(' '.join(quoted) + ' || exit\n')
return abs_obj
@ -71,7 +74,7 @@ class ShellGenerator():
commands += dep.get_link_flags()
commands += linker.get_output_flags()
commands.append(outname)
quoted = environment.shell_quote(commands)
quoted = shell_quote(commands)
outfile.write('\necho Linking \\"%s\\".\n' % outname)
outfile.write(' '.join(quoted) + ' || exit\n')

@ -1,3 +1,4 @@
project('trivial test')
language('c')
exe = executable('trivialprog', 'trivial.c')

@ -0,0 +1,3 @@
int main(int argv, char **argv) {
return 0;
}
Loading…
Cancel
Save