summaryrefslogtreecommitdiffstats
path: root/DOCS/client_api_examples
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-01 23:56:41 +0100
committerwm4 <wm4@nowhere>2015-01-02 00:00:03 +0100
commit4ed0907f2d596ba66652ca6d739cc12dae7dc2a0 (patch)
tree129a7b1670e0a4328d60d6cf7de7f9539d87ae09 /DOCS/client_api_examples
parentda4f7225796037b814919e79912cfaa7a9ddc113 (diff)
downloadmpv-4ed0907f2d596ba66652ca6d739cc12dae7dc2a0.tar.bz2
mpv-4ed0907f2d596ba66652ca6d739cc12dae7dc2a0.tar.xz
build: try to make examples build both in-tree and out-of-tree
The examples simple.c and cocoabasic.m can be compiled without installing libmpv. But also, they didn't use the correct include path libmpv programs normally use, so they couldn't be built with a properly installed system-libmpv. That's pretty bad for examples, which are supposed to show how to use libmpv correctly. So do some bullshit that symlinks libmpv to a "mpv" include directory under the build directory. This name-mismatch is a direct consequence of the bullshit done in 499a6758 (requested in #539 for dumb reasons). (We don't want to name the client API headers directory "mpv", because that would be too unspecific, and clashes with having the mpv binary in the same directory.) If you have spaces or other "unusual" characters in your paths, the build will break, because I couldn't find out where waf hides its function to escape shell parameters (or a way to invoke programs without involving the shell). Neither does such a thing to be documented, nor do they seem to have a clear way to do this in their code. This also doesn't compile the Qt examples, because everything becomes even more terrible from there on.
Diffstat (limited to 'DOCS/client_api_examples')
-rw-r--r--DOCS/client_api_examples/cocoa/cocoabasic.m2
-rw-r--r--DOCS/client_api_examples/simple/simple.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/DOCS/client_api_examples/cocoa/cocoabasic.m b/DOCS/client_api_examples/cocoa/cocoabasic.m
index 74f8f2e864..ea3e9c69d5 100644
--- a/DOCS/client_api_examples/cocoa/cocoabasic.m
+++ b/DOCS/client_api_examples/cocoa/cocoabasic.m
@@ -3,7 +3,7 @@
// but that's not quite ready yet.
// You may need a basic Info.plist and MainMenu.xib to make this work.
-#include "libmpv/client.h"
+#include <mpv/client.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/DOCS/client_api_examples/simple/simple.c b/DOCS/client_api_examples/simple/simple.c
index 62fc9e8061..ca8699a076 100644
--- a/DOCS/client_api_examples/simple/simple.c
+++ b/DOCS/client_api_examples/simple/simple.c
@@ -2,7 +2,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "libmpv/client.h"
+#include <mpv/client.h>
static inline void check_error(int status)
{