diff options
author | Akemi <der.richter@gmx.de> | 2018-10-27 17:27:01 +0200 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2018-10-28 15:48:37 +0200 |
commit | eab30807fe6835996105c9afbad63cec0cbc6c5c (patch) | |
tree | fee31d2ac8063d8c6cbd0b67c83b8cba581deaba /wscript_build.py | |
parent | ba2dee38fbd33adcb5405e0726f5baaa75128ccc (diff) | |
download | mpv-eab30807fe6835996105c9afbad63cec0cbc6c5c.tar.bz2 mpv-eab30807fe6835996105c9afbad63cec0cbc6c5c.tar.xz |
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 'wscript_build.py')
-rw-r--r-- | wscript_build.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/wscript_build.py b/wscript_build.py index 35b16856ea..64560b863d 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -142,16 +142,24 @@ def build(ctx): ctx(features = "ebml_definitions", target = "ebml_defs.c") def swift(task): - src = ' '.join([x.abspath() for x in task.inputs]) + src = [x.abspath() for x in task.inputs] bridge = ctx.path.find_node("osdep/macOS_swift_bridge.h").abspath() tgt = task.outputs[0].abspath() header = task.outputs[1].abspath() module = task.outputs[2].abspath() - cmd = ('%s %s -module-name macOS_swift -emit-module-path %s ' - '-import-objc-header %s -emit-objc-header-path %s -o %s %s ' - '-I. -I%s') % (ctx.env.SWIFT, ctx.env.SWIFT_FLAGS, module, - bridge, header, tgt, src, ctx.srcnode.abspath()) + cmd = [ ctx.env.SWIFT ] + cmd.extend(ctx.env.SWIFT_FLAGS) + cmd.extend([ + "-module-name", "macOS_swift", + "-emit-module-path", module, + "-import-objc-header", bridge, + "-emit-objc-header-path", header, + "-o", tgt, + ]) + cmd.extend(src) + cmd.extend([ "-I.", "-I%s" % ctx.srcnode.abspath() ]) + return task.exec_command(cmd) if ctx.dependency_satisfied('macos-cocoa-cb'): @@ -166,15 +174,15 @@ def build(ctx): ctx( rule = swift, source = ctx.filtered_sources(swift_source), - target = ('osdep/macOS_swift.o ' - 'osdep/macOS_swift.h ' - 'osdep/macOS_swift.swiftmodule'), + target = [ "osdep/macOS_swift.o", + "osdep/macOS_swift.h", + "osdep/macOS_swift.swiftmodule" ], before = 'c', ) ctx.env.append_value('LINKFLAGS', [ '-Xlinker', '-add_ast_path', - '-Xlinker', '%s' % ctx.path.find_or_declare("osdep/macOS_swift.swiftmodule").abspath() + '-Xlinker', ctx.path.find_or_declare("osdep/macOS_swift.swiftmodule").abspath() ]) if ctx.dependency_satisfied('cplayer'): |