Commit c8b11fad authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

lib: add a version header

parent 48799376
......@@ -64,7 +64,7 @@ wp_lib_headers = files(
)
install_headers(wp_lib_headers,
subdir : join_paths('wireplumber-' + wireplumber_api_version, 'wp')
install_dir : wireplumber_headers_dir
)
enums = gnome.mkenums_simple('wpenums',
......@@ -72,14 +72,25 @@ enums = gnome.mkenums_simple('wpenums',
header_prefix: '#include "wp/defs.h"',
decorator: 'WP_API',
install_header: true,
install_dir: join_paths(get_option('includedir'), 'wireplumber-' + wireplumber_api_version, 'wp'),
install_dir: wireplumber_headers_dir,
)
wpenums_h = enums[1]
wpenums_c = enums[0]
wp_gen_sources = [wpenums_h]
wpversion_data = configuration_data()
wpversion_data.set('version', meson.project_version())
wpversion_data.set('api_version', wireplumber_api_version)
wpversion = configure_file(
input : 'wpversion.h.in',
output : 'wpversion.h',
configuration : wpversion_data,
install_dir: wireplumber_headers_dir
)
wp_gen_sources += [wpversion]
wp_lib = library('wireplumber-' + wireplumber_api_version,
wp_lib_sources, wpenums_c, wpenums_h,
wp_lib_sources, wpenums_c, wpenums_h, wpversion,
c_args : [
'-D_GNU_SOURCE',
'-DG_LOG_USE_STRUCTURED',
......
......@@ -48,7 +48,7 @@ wp_init (WpInitFlags flags)
g_log_set_writer_func (wp_log_writer_default, NULL, NULL);
/* a dummy message, to initialize the logging system */
wp_info ("WirePlumber initializing");
wp_info ("WirePlumber " WIREPLUMBER_VERSION " initializing");
if (flags & WP_INIT_SET_PW_LOG && !g_getenv ("WIREPLUMBER_NO_PW_LOG")) {
pw_log_level = lvl = wp_spa_log_get_instance ()->level;
......
......@@ -38,6 +38,7 @@
#include "spa-type.h"
#include "transition.h"
#include "wpenums.h"
#include "wpversion.h"
G_BEGIN_DECLS
......
#define WIREPLUMBER_VERSION "@version@"
#define WIREPLUMBER_API_VERSION "@api_version@"
......@@ -12,6 +12,8 @@ project('wireplumber', ['c', 'cpp'],
wireplumber_api_version = '0.1'
wireplumber_so_version = '0'
wireplumber_headers_dir = join_paths(get_option('includedir'), 'wireplumber-' + wireplumber_api_version, 'wp')
if get_option('libdir').startswith('/')
wireplumber_module_dir = join_paths(get_option('libdir'), 'wireplumber-' + wireplumber_api_version)
else
......
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