summaryrefslogtreecommitdiffstats
path: root/wscript_build.py
diff options
context:
space:
mode:
Diffstat (limited to 'wscript_build.py')
-rw-r--r--wscript_build.py73
1 files changed, 38 insertions, 35 deletions
diff --git a/wscript_build.py b/wscript_build.py
index 066ede1274..091f938275 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -129,38 +129,38 @@ def build(ctx):
ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
protocol = "unstable/idle-inhibit/idle-inhibit-unstable-v1",
target = "video/out/wayland/idle-inhibit-v1.h")
- ctx.wayland_protocol_code(proto_dir = "video/out/wayland",
- protocol = "server-decoration",
- vendored_protocol = True,
- target = "video/out/wayland/srv-decor.c")
- ctx.wayland_protocol_header(proto_dir = "video/out/wayland",
- protocol = "server-decoration",
- vendored_protocol = True,
- target = "video/out/wayland/srv-decor.h")
+ ctx.wayland_protocol_code(proto_dir = ctx.env.WL_PROTO_DIR,
+ protocol = "unstable/xdg-decoration/xdg-decoration-unstable-v1",
+ target = "video/out/wayland/xdg-decoration-v1.c")
+ ctx.wayland_protocol_header(proto_dir = ctx.env.WL_PROTO_DIR,
+ protocol = "unstable/xdg-decoration/xdg-decoration-unstable-v1",
+ target = "video/out/wayland/xdg-decoration-v1.h")
ctx(features = "ebml_header", target = "ebml_types.h")
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()
+ module_name = os.path.basename(module).rsplit(".", 1)[0]
+
+ cmd = [ ctx.env.SWIFT ]
+ cmd.extend(ctx.env.SWIFT_FLAGS)
+ cmd.extend([
+ "-module-name", module_name,
+ "-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() ])
- 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..') % (ctx.env.SWIFT, ctx.env.SWIFT_FLAGS, module,
- bridge, header, tgt, src)
return task.exec_command(cmd)
- if ctx.dependency_satisfied('cocoa') and ctx.env.MACOS_SDK:
- # on macOS we explicitly need to set the SDK path, otherwise it can lead to
- # linking warnings or errors
- ctx.env.append_value('LINKFLAGS', [
- '-isysroot', ctx.env.MACOS_SDK
- ])
-
if ctx.dependency_satisfied('macos-cocoa-cb'):
swift_source = [
( "osdep/macOS_mpv_helper.swift" ),
@@ -173,15 +173,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'):
@@ -448,7 +448,7 @@ def build(ctx):
( "video/out/opengl/angle_dynamic.c", "egl-angle" ),
( "video/out/opengl/common.c", "gl" ),
( "video/out/opengl/context.c", "gl" ),
- ( "video/out/opengl/context_android.c", "android" ),
+ ( "video/out/opengl/context_android.c", "egl-android" ),
( "video/out/opengl/context_angle.c", "egl-angle-win32" ),
( "video/out/opengl/context_cocoa.c", "gl-cocoa" ),
( "video/out/opengl/context_drm_egl.c", "egl-drm" ),
@@ -500,11 +500,10 @@ def build(ctx):
( "video/out/vulkan/formats.c", "vulkan" ),
( "video/out/vulkan/malloc.c", "vulkan" ),
( "video/out/vulkan/ra_vk.c", "vulkan" ),
- ( "video/out/vulkan/spirv_nvidia.c", "vulkan" ),
( "video/out/vulkan/utils.c", "vulkan" ),
( "video/out/w32_common.c", "win32-desktop" ),
( "video/out/wayland/idle-inhibit-v1.c", "wayland" ),
- ( "video/out/wayland/srv-decor.c", "wayland" ),
+ ( "video/out/wayland/xdg-decoration-v1.c", "wayland" ),
( "video/out/wayland/xdg-shell.c", "wayland" ),
( "video/out/wayland_common.c", "wayland" ),
( "video/out/win32/displayconfig.c", "win32-desktop" ),
@@ -617,8 +616,8 @@ def build(ctx):
wrapctx.env.cprogram_PATTERN = "%s.com"
wrapflags = ['-municode', '-mconsole']
- wrapctx.env.CFLAGS = wrapflags
- wrapctx.env.LAST_LINKFLAGS = wrapflags
+ wrapctx.env.CFLAGS = ctx.env.CFLAGS + wrapflags
+ wrapctx.env.LAST_LINKFLAGS = ctx.env.LAST_LINKFLAGS + wrapflags
if ctx.dependency_satisfied('test'):
for test in ctx.path.ant_glob("test/*.c"):
@@ -683,11 +682,15 @@ def build(ctx):
_build_libmpv(False)
def get_deps():
- res = ""
+ res = []
for k in ctx.env.keys():
- if k.startswith("LIB_") and k != "LIB_ST":
- res += " ".join(["-l" + x for x in ctx.env[k]]) + " "
- return res
+ if (k.startswith("LIB_") and k != "LIB_ST") \
+ or (k.startswith("STLIB_") and k != "STLIB_ST" and k != "STLIB_MARKER"):
+ for l in ctx.env[k]:
+ if l in res:
+ res.remove(l)
+ res.append(l)
+ return " ".join(["-l" + l for l in res])
ctx(
target = 'libmpv/mpv.pc',
@@ -695,7 +698,7 @@ def build(ctx):
features = 'subst',
PREFIX = ctx.env.PREFIX,
LIBDIR = ctx.env.LIBDIR,
- INCDIR = ctx.env.INCDIR,
+ INCDIR = ctx.env.INCLUDEDIR,
VERSION = libversion,
PRIV_LIBS = get_deps(),
)
@@ -703,7 +706,7 @@ def build(ctx):
headers = ["client.h", "qthelper.hpp", "opengl_cb.h", "render.h",
"render_gl.h", "stream_cb.h"]
for f in headers:
- ctx.install_as(ctx.env.INCDIR + '/mpv/' + f, 'libmpv/' + f)
+ ctx.install_as(ctx.env.INCLUDEDIR + '/mpv/' + f, 'libmpv/' + f)
ctx.install_as(ctx.env.LIBDIR + '/pkgconfig/mpv.pc', 'libmpv/mpv.pc')