diff options
author | wm4 <wm4@nowhere> | 2014-08-05 02:23:14 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-08-05 02:23:14 +0200 |
commit | 43ddf2099baf01ae22985f60e0f735a00f578844 (patch) | |
tree | 6d9fc6e5660c382e618852f4a21650d357f397a7 /wscript_build.py | |
parent | bdf607ea5f218b1aa60dff9abc94b68e1a934368 (diff) | |
download | mpv-43ddf2099baf01ae22985f60e0f735a00f578844.tar.bz2 mpv-43ddf2099baf01ae22985f60e0f735a00f578844.tar.xz |
client API: add and use the MPV_MAKE_VERSION macro
This is probably nicer. The actual version number doesn't change (other
than the minor being incremented).
The "| 0UL" is to make the type unsigned long int, like it was before.
Diffstat (limited to 'wscript_build.py')
-rw-r--r-- | wscript_build.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/wscript_build.py b/wscript_build.py index 5eebf89ee8..593d5bb2a7 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -450,11 +450,10 @@ def build(ctx): if build_shared or build_static: if build_shared: ctx.load("syms") - vnum = int(re.search('^#define MPV_CLIENT_API_VERSION 0x(.*)UL$', - ctx.path.find_node("libmpv/client.h").read(), - re.M) - .group(1), 16) - libversion = str(vnum >> 16) + '.' + str(vnum & 0xffff) + '.0' + vre = '^#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION\((.*), (.*)\)$' + libmpv_header = ctx.path.find_node("libmpv/client.h").read() + major, minor = re.search(vre, libmpv_header, re.M).groups() + libversion = major + '.' + minor + '.0' def _build_libmpv(shared): features = "c " |