1 |
https://github.com/mesonbuild/meson/pull/4348 |
2 |
|
3 |
From ca946665fe824c2010a96f659cff3ae21cecd910 Mon Sep 17 00:00:00 2001 |
4 |
From: Ting-Wei Lan <lantw@src.gnome.org> |
5 |
Date: Mon, 8 Oct 2018 23:44:33 +0800 |
6 |
Subject: [PATCH] gnome: Quote arguments passed to gtkdoc-scangobj |
7 |
|
8 |
It is possible for compiler flags to include special characters, such as |
9 |
double quotes which are needed to define macros with -D options. Since |
10 |
gtkdoc-scangobj uses shlex.split to split arguments passed to --cc, |
11 |
--ld, --cflags, --ldflags into lists, we can safely use shlex.quote to |
12 |
properly quote arguments for these options. |
13 |
--- mesonbuild/modules/gnome.py.orig 2018-09-22 13:22:03 UTC |
14 |
+++ mesonbuild/modules/gnome.py |
15 |
@@ -17,6 +17,7 @@ functionality such as gobject-introspect |
16 |
|
17 |
import os |
18 |
import copy |
19 |
+import shlex |
20 |
import subprocess |
21 |
|
22 |
from .. import build |
23 |
@@ -1014,12 +1015,12 @@ This will become a hard error in the fut |
24 |
compiler = state.environment.coredata.compilers.get('c') |
25 |
|
26 |
if compiler: |
27 |
- args += ['--cc=%s' % ' '.join(compiler.get_exelist())] |
28 |
- args += ['--ld=%s' % ' '.join(compiler.get_linker_exelist())] |
29 |
+ args += ['--cc=%s' % ' '.join([shlex.quote(x) for x in compiler.get_exelist()])] |
30 |
+ args += ['--ld=%s' % ' '.join([shlex.quote(x) for x in compiler.get_linker_exelist()])] |
31 |
if cflags: |
32 |
- args += ['--cflags=%s' % ' '.join(cflags)] |
33 |
+ args += ['--cflags=%s' % ' '.join([shlex.quote(x) for x in cflags])] |
34 |
if ldflags: |
35 |
- args += ['--ldflags=%s' % ' '.join(ldflags)] |
36 |
+ args += ['--ldflags=%s' % ' '.join([shlex.quote(x) for x in ldflags])] |
37 |
|
38 |
return args |
39 |
|