From eab30807fe6835996105c9afbad63cec0cbc6c5c Mon Sep 17 00:00:00 2001 From: Akemi Date: Sat, 27 Oct 2018 17:27:01 +0200 Subject: build: use an argument list for the Swift build args that way we don't need to quote or escape anything. Fixes #6220 --- waftools/detections/compiler_swift.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'waftools/detections/compiler_swift.py') 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', [ -- cgit v1.2.3