aboutsummaryrefslogtreecommitdiffhomepage
path: root/waftools/detections
diff options
context:
space:
mode:
authorGravatar Akemi <der.richter@gmx.de>2018-10-27 17:27:01 +0200
committerGravatar Jan Ekström <jeebjp@gmail.com>2018-10-28 15:48:37 +0200
commiteab30807fe6835996105c9afbad63cec0cbc6c5c (patch)
treefee31d2ac8063d8c6cbd0b67c83b8cba581deaba /waftools/detections
parentba2dee38fbd33adcb5405e0726f5baaa75128ccc (diff)
build: use an argument list for the Swift build args
that way we don't need to quote or escape anything. Fixes #6220
Diffstat (limited to 'waftools/detections')
-rw-r--r--waftools/detections/compiler_swift.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/waftools/detections/compiler_swift.py b/waftools/detections/compiler_swift.py
index 3c130302be..d4ba162667 100644
--- a/waftools/detections/compiler_swift.py
+++ b/waftools/detections/compiler_swift.py
@@ -9,9 +9,11 @@ def __run(cmd):
return ""
def __add_swift_flags(ctx):
- ctx.env.SWIFT_FLAGS = ('-frontend -c -sdk %s -enable-objc-interop'
- ' -emit-objc-header -parse-as-library'
- ' -target x86_64-apple-macosx10.10') % (ctx.env.MACOS_SDK)
+ ctx.env.SWIFT_FLAGS = [
+ "-frontend", "-c", "-sdk", ctx.env.MACOS_SDK,
+ "-enable-objc-interop", "-emit-objc-header", "-parse-as-library",
+ "-target", "x86_64-apple-macosx10.10"
+ ]
ver = re.compile("(?i)version\s?([\d.]+)")
ctx.env.SWIFT_VERSION = ver.search(__run([ctx.env.SWIFT, '-version'])).group(1)
@@ -19,10 +21,10 @@ def __add_swift_flags(ctx):
# the -swift-version parameter is only supported on swift 3.1 and newer
if major >= 3 and minor >= 1 or major >= 4:
- ctx.env.SWIFT_FLAGS += ' -swift-version 3'
+ ctx.env.SWIFT_FLAGS.extend([ "-swift-version", "3" ])
if ctx.is_optimization():
- ctx.env.SWIFT_FLAGS += ' -O'
+ ctx.env.SWIFT_FLAGS.append("-O")
def __add_swift_library_linking_flags(ctx, swift_library):
ctx.env.append_value('LINKFLAGS', [