diff options
author | Thibault Saunier <thibault.saunier@osg.samsung.com> | 2017-08-25 15:16:17 -0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-25 01:10:52 +0200 |
commit | c48b9594ff1ffc9dacdcb0f4fca6f459b95989f5 (patch) | |
tree | bc57b20c3714fc7cd024cdb63fce71b3669914fa /mesonbuild/backend/ninjabackend.py | |
parent | e2a4cff76f35b7c666a0bcaa087bcdef579ef19f (diff) | |
download | meson-c48b9594ff1ffc9dacdcb0f4fca6f459b95989f5.zip meson-c48b9594ff1ffc9dacdcb0f4fca6f459b95989f5.tar.gz meson-c48b9594ff1ffc9dacdcb0f4fca6f459b95989f5.tar.bz2 |
Add support for Visual Studio csc c# compiler
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index e8c8b39..8b616a6 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -103,7 +103,8 @@ class NinjaBuildElement: # This is the only way I could find to make this work on all # platforms including Windows command shell. Slash is a dir separator # on Windows, too, so all characters are unambiguous and, more importantly, - # do not require quoting. + # do not require quoting, unless explicitely specified, which is necessary for + # the csc compiler. line = line.replace('\\', '/') outfile.write(line) @@ -988,7 +989,7 @@ int dummy; outname_rel = os.path.join(self.get_target_dir(target), fname) src_list = target.get_sources() compiler = target.compilers['cs'] - rel_srcs = [s.rel_to_builddir(self.build_to_src) for s in src_list] + rel_srcs = [os.path.normpath(s.rel_to_builddir(self.build_to_src)) for s in src_list] deps = [] commands = CompilerArgs(compiler, target.extra_args.get('cs', [])) commands += compiler.get_buildtype_args(buildtype) @@ -1014,8 +1015,8 @@ int dummy; for rel_src in generated_sources.keys(): dirpart, fnamepart = os.path.split(rel_src) if rel_src.lower().endswith('.cs'): - rel_srcs.append(rel_src) - deps.append(rel_src) + rel_srcs.append(os.path.normpath(rel_src)) + deps.append(os.path.normpath(rel_src)) for dep in target.get_external_deps(): commands.extend_direct(dep.get_link_args()) @@ -1588,7 +1589,15 @@ int dummy; def generate_cs_compile_rule(self, compiler, outfile): rule = 'rule %s_COMPILER\n' % compiler.get_language() invoc = ' '.join([ninja_quote(i) for i in compiler.get_exelist()]) - command = ' command = %s $ARGS $in\n' % invoc + + if mesonlib.is_windows(): + command = ''' command = {executable} @$out.rsp + rspfile = $out.rsp + rspfile_content = $ARGS $in +'''.format(executable=invoc) + else: + command = ' command = %s $ARGS $in\n' % invoc + description = ' description = Compiling C Sharp target $out.\n' outfile.write(rule) outfile.write(command) |