diff --git a/environment.py b/environment.py index 097ba1f1a..dabb74e13 100755 --- a/environment.py +++ b/environment.py @@ -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 diff --git a/shellgenerator.py b/shellgenerator.py index 49267f3e8..4ce023f67 100755 --- a/shellgenerator.py +++ b/shellgenerator.py @@ -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') diff --git a/test cases/1 trivial/builder.txt b/test cases/1 trivial/builder.txt index fdd1c6245..0ab3f5d93 100644 --- a/test cases/1 trivial/builder.txt +++ b/test cases/1 trivial/builder.txt @@ -1,3 +1,4 @@ project('trivial test') language('c') +exe = executable('trivialprog', 'trivial.c') diff --git a/test cases/1 trivial/trivial.c b/test cases/1 trivial/trivial.c new file mode 100644 index 000000000..363dac39d --- /dev/null +++ b/test cases/1 trivial/trivial.c @@ -0,0 +1,3 @@ +int main(int argv, char **argv) { + return 0; +}