diff options
author | Nicolas Schneider <nioncode+github@gmail.com> | 2016-04-06 21:10:29 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2016-04-06 22:10:29 +0300 |
commit | 536edb65d6d379f8eb50c2c1c9d21362ab5f75a1 (patch) | |
tree | 02548858ca8b48ff0653408e73b325b3da94f0b4 /mesonbuild/backend/vs2010backend.py | |
parent | e44229b9c265a6cc1d56d5e16b51af527e32dfb3 (diff) | |
download | meson-536edb65d6d379f8eb50c2c1c9d21362ab5f75a1.zip meson-536edb65d6d379f8eb50c2c1c9d21362ab5f75a1.tar.gz meson-536edb65d6d379f8eb50c2c1c9d21362ab5f75a1.tar.bz2 |
vs2010: replace " with \" in /D command line args
The /D switch strips any quotes except when they are escaped.
Diffstat (limited to 'mesonbuild/backend/vs2010backend.py')
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index ae4cd33..36b7d57 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -14,6 +14,7 @@ import os, sys import pickle +import re from mesonbuild import compilers from mesonbuild.build import BuildTarget @@ -376,6 +377,10 @@ class Vs2010Backend(backends.Backend): lang = Vs2010Backend.lang_from_source_file(source_file) ET.SubElement(parent_node, "AdditionalOptions").text = ' '.join(extra_args[lang]) + ' %(AdditionalOptions)' + @classmethod + def quote_define_cmdline(cls, arg): + return re.sub(r'^([-/])D(.*?)="(.*)"$', r'\1D\2=\"\3\"', arg) + def gen_vcxproj(self, target, ofname, guid, compiler): mlog.debug('Generating vcxproj %s.' % target.name) entrypoint = 'WinMainCRTStartup' @@ -475,6 +480,9 @@ class Vs2010Backend(backends.Backend): except AttributeError: pass + for l, args in extra_args.items(): + extra_args[l] = [Vs2010Backend.quote_define_cmdline(x) for x in args] + languages += gen_langs has_language_specific_args = any(l != extra_args['c'] for l in extra_args.values()) additional_options_set = False |