aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-04-21 19:14:55 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2021-04-22 16:53:43 +0300
commit965f7e18fa5aa7c3cdce826ffee03cfdf1c47b18 (patch)
tree648c6ae63219b7e75c3a9dcc53caec58eef98ee5
parentb9b00c714e5d6708e408b6dd2239bb38a6b853de (diff)
downloadmeson-965f7e18fa5aa7c3cdce826ffee03cfdf1c47b18.zip
meson-965f7e18fa5aa7c3cdce826ffee03cfdf1c47b18.tar.gz
meson-965f7e18fa5aa7c3cdce826ffee03cfdf1c47b18.tar.bz2
Xcode: fix shell quotings.
-rw-r--r--mesonbuild/backend/xcodebackend.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py
index 49e7595..b81b905 100644
--- a/mesonbuild/backend/xcodebackend.py
+++ b/mesonbuild/backend/xcodebackend.py
@@ -1114,7 +1114,7 @@ class XCodeBackend(backends.Backend):
custom_dict.add_item('runOnlyForDeploymentPostprocessing', 0)
custom_dict.add_item('shellPath', '/bin/sh')
workdir = self.environment.get_build_dir()
- cmdstr = ' '.join([f'\\"{x}\\"' for x in fixed_cmd])
+ cmdstr = ' '.join([f"\\'{x}\\'" for x in fixed_cmd])
custom_dict.add_item('shellScript', f'"cd {workdir}; {cmdstr}"')
custom_dict.add_item('showEnvVarsInLog', 0)
@@ -1494,7 +1494,7 @@ class XCodeBackend(backends.Backend):
# b) I don't know why it works or why every backslash must be escaped into eight backslashes
a = a.replace(chr(92), 8*chr(92)) # chr(92) is backslash, this how we smuggle it in without Python's quoting grabbing it.
a = a.replace(r'"', r'\\\"')
- if ' ' in a:
+ if ' ' in a or "'" in a:
a = r'\"' + a + r'\"'
quoted_args.append(a)
settings_dict.add_item(f'OTHER_{langname}FLAGS', '"' + ' '.join(quoted_args) + '"')