summaryrefslogtreecommitdiffstats
path: root/wscript_build.py
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-01-12 17:37:11 +0100
committerwm4 <wm4@nowhere>2017-01-12 17:45:11 +0100
commit44e06b70d504d5a9073990851a353820370f3667 (patch)
treeffda223303ae592718ae8c2daadfc40b77f37808 /wscript_build.py
parentac98ff71ddf3da7d864f149fc290fa07600b311a (diff)
downloadmpv-44e06b70d504d5a9073990851a353820370f3667.tar.bz2
mpv-44e06b70d504d5a9073990851a353820370f3667.tar.xz
player: add experimental C plugin interface
This basically reuses the scripting infrastructure. Note that this needs to be explicitly enabled at compilation. For one, enabling export for certain symbols from an executable seems to be quite toolchain-specific. It might not work outside of Linux and cause random problems within Linux. If C plugins actually become commonly used and this approach is starting to turn out as a problem, we can build mpv CLI as a wrapper for libmpv, which would remove the requirement that plugins pick up host symbols. I'm being lazy, so implementation/documentation are parked in existing files, even if that stuff doesn't necessarily belong there. Sue me, or better send patches.
Diffstat (limited to 'wscript_build.py')
-rw-r--r--wscript_build.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/wscript_build.py b/wscript_build.py
index 8e3cb6aa8e..9e213e824e 100644
--- a/wscript_build.py
+++ b/wscript_build.py
@@ -470,13 +470,19 @@ def build(ctx):
features = "c",
)
+ syms = False
+ if ctx.dependency_satisfied('cplugins'):
+ syms = True
+ ctx.load("syms")
+
if ctx.dependency_satisfied('cplayer'):
ctx(
target = "mpv",
source = main_fn_c,
use = ctx.dependencies_use() + ['objects'],
includes = _all_includes(ctx),
- features = "c cprogram",
+ features = "c cprogram" + (" syms" if syms else ""),
+ export_symbols_def = "libmpv/mpv.def", # for syms=True
install_path = ctx.env.BINDIR
)
for f in ['mpv.conf', 'input.conf', 'mplayer-input.conf', \