aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xenvironment.py3
-rwxr-xr-xshellgenerator.py7
-rw-r--r--test cases/1 trivial/builder.txt1
-rw-r--r--test cases/1 trivial/trivial.c3
4 files changed, 9 insertions, 5 deletions
diff --git a/environment.py b/environment.py
index 097ba1f..dabb74e 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 49267f3..4ce023f 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 fdd1c62..0ab3f5d 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 0000000..363dac3
--- /dev/null
+++ b/test cases/1 trivial/trivial.c
@@ -0,0 +1,3 @@
+int main(int argv, char **argv) {
+ return 0;
+}