diff options
Diffstat (limited to 'waftools')
-rw-r--r-- | waftools/detections/compiler_swift.py | 12 |
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', [ |