Commit 082956d3 authored by Niklas Haas's avatar Niklas Haas

config.h: describe the version in more detail

parent 81e367fe
......@@ -18,7 +18,17 @@
#ifndef LIBPLACEBO_CONFIG_H_
#define LIBPLACEBO_CONFIG_H_
// Increased any time the API changes.
// Increased any time the library changes in a fundamental/major way.
#define PL_MAJOR_VER @majorver@
// Increased any time the API changes. (Note: Does not reset when PL_MAJOR_VER
// is increased)
#define PL_API_VER @apiver@
// Increased any time a fix is made to a given API version.
#define PL_FIX_VER @fixver@
// Friendly name (`git describe`) for the overall version of the library
#define PL_VERSION @version@
#endif // LIBPLACEBO_CONTEXT_H_
......@@ -2,6 +2,8 @@ majorver = '0'
apiver = '0'
fixver = '0'
version = majorver + '.' + apiver + '.' + fixver
# Build options mostly taken from mpv
add_global_arguments([
'-D_ISOC99_SOURCE', '-D_GNU_SOURCE',
......@@ -22,7 +24,16 @@ deps = [
# Configuration
conf = configuration_data()
conf.set('majorver', majorver)
conf.set('apiver', apiver)
conf.set('fixver', fixver)
gitdesc = run_command('git', 'describe')
if gitdesc.returncode() == 0
conf.set_quoted('version', gitdesc.stdout().strip())
else
conf.set_quoted('version', 'v' + version)
endif
configure_file(
input: 'config.h.in',
......@@ -68,5 +79,5 @@ pkg.generate(
name: meson.project_name(),
description: 'Reusable library for GPU-accelerated video/image rendering',
libraries: '-lplacebo',
version: majorver + '.' + apiver + '.' + fixver,
version: version,
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment