diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-08 18:29:37 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-03-08 18:29:37 +0200 |
commit | 7ced6d2071fff5cba845b91d4cd8d4214d157fab (patch) | |
tree | 472c67c4cf73c2ead20675fd2de02a77bca4a355 | |
parent | 4dda53483e8be4d7a76a61ef027a857bba652953 (diff) | |
download | meson-7ced6d2071fff5cba845b91d4cd8d4214d157fab.zip meson-7ced6d2071fff5cba845b91d4cd8d4214d157fab.tar.gz meson-7ced6d2071fff5cba845b91d4cd8d4214d157fab.tar.bz2 |
First unit test compiles on Windows/MinGW.
-rwxr-xr-x | backends.py | 10 | ||||
-rwxr-xr-x | environment.py | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/backends.py b/backends.py index 6637156..fd13492 100755 --- a/backends.py +++ b/backends.py @@ -19,6 +19,11 @@ import interpreter, nodes import environment from meson_install import InstallData +if environment.is_windows(): + quote_char = '"' +else: + quote_char = "'" + def shell_quote(cmdlist): return ["'" + x + "'" for x in cmdlist] @@ -210,7 +215,7 @@ class NinjaBuildElement(): if name == 'DEPFILE' or name == 'DESC': should_quote = False line = ' %s = ' % name - q_templ = "'%s'" + q_templ = quote_char + "%s" + quote_char noq_templ = "%s" newelems = [] for i in elems: @@ -407,13 +412,14 @@ class NinjaBackend(Backend): outfile.write('\n') def generate_compile_rules(self, outfile): + qstr = quote_char + "%s" + quote_char for compiler in self.build.compilers: langname = compiler.get_language() rule = 'rule %s_COMPILER\n' % langname depflags = compiler.get_dependency_gen_flags('$out', '$DEPFILE') command = " command = %s $FLAGS %s %s $out %s $in\n" % \ (' '.join(compiler.get_exelist()),\ - ' '.join(['\'%s\''% d for d in depflags]),\ + ' '.join([qstr % d for d in depflags]),\ ' '.join(compiler.get_output_flags()),\ ' '.join(compiler.get_compile_only_flags())) description = ' description = Compiling %s object $out\n' % langname diff --git a/environment.py b/environment.py index 85ffd17..b8fa5ce 100755 --- a/environment.py +++ b/environment.py @@ -228,6 +228,7 @@ def is_osx(): return platform.system().lower() == 'darwin' def is_windows(): + print(platform.system().lower()) return platform.system().lower() == 'windows' header_suffixes = ['h', 'hh', 'hpp', 'hxx', 'H'] @@ -237,7 +238,7 @@ class Environment(): coredata_file = os.path.join(private_dir, 'coredata.dat') def __init__(self, source_dir, build_dir, main_script_file, options): - assert(main_script_file[0] == '/') + assert(os.path.isabs(main_script_file)) assert(not os.path.islink(main_script_file)) self.source_dir = source_dir self.build_dir = build_dir |