From ff1384962449f4a2a1a6b2eada5582bdc2c61bd5 Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Wed, 27 Dec 2017 14:37:55 +0100 Subject: config: Avoid clash with other config-headers --- include/wlr/meson.build | 1 + include/wlr/xwayland.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 include/wlr/meson.build (limited to 'include/wlr') diff --git a/include/wlr/meson.build b/include/wlr/meson.build new file mode 100644 index 00000000..508abfe7 --- /dev/null +++ b/include/wlr/meson.build @@ -0,0 +1 @@ +configure_file(output: 'config.h', install_dir: 'include/wlr', configuration: conf_data) diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index 37b09204..8d71a7ab 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -3,7 +3,7 @@ #include #include -#include "config.h" +#include #include #include #include -- cgit v1.2.3 From 892f7a5db022ffec5cb6fe363d9a929e475c22d0 Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Wed, 27 Dec 2017 15:56:07 +0100 Subject: include: Install headers in an isolated include-dir --- include/wlr/meson.build | 3 ++- meson.build | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) (limited to 'include/wlr') diff --git a/include/wlr/meson.build b/include/wlr/meson.build index 508abfe7..eb0248d7 100644 --- a/include/wlr/meson.build +++ b/include/wlr/meson.build @@ -1 +1,2 @@ -configure_file(output: 'config.h', install_dir: 'include/wlr', configuration: conf_data) +header_install_dir = 'include/@0@/wlr'.format(meson.project_name()) +configure_file(output: 'config.h', install_dir: header_install_dir, configuration: conf_data) diff --git a/meson.build b/meson.build index 21e6e381..7d4997ad 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,7 @@ project( 'wlroots', 'c', + version: '0.0.1', license: 'MIT', meson_version: '>=0.43.0', default_options: [ @@ -80,16 +81,21 @@ if elogind.found() and get_option('enable_elogind') conf_data.set('WLR_HAS_ELOGIND', true) endif -exclude_files = [] +exclude_headers = [] wlr_parts = [] if get_option('enable_xwayland') subdir('xwayland') wlr_parts += [lib_wlr_xwayland] conf_data.set('WLR_HAS_XWAYLAND', true) + exclude_headers += 'xwayland.h' + exclude_headers += 'xwm.h' else - exclude_files += ['xwayland.h', 'xwm.h'] + exclude_headers += 'xwayland.h' + exclude_headers += 'xwm.h' endif -install_subdir('include/wlr', install_dir: 'include', exclude_files: exclude_files) +exclude_headers += 'meson.build' +header_install_dir = 'include/@0@'.format(meson.project_name()) +install_subdir('include/wlr', install_dir: header_install_dir, exclude_files: exclude_headers) subdir('include') @@ -150,8 +156,9 @@ subdir('examples') pkgconfig = import('pkgconfig') pkgconfig.generate( libraries: lib_wlr, - version: '0.0.1', - filebase: 'wlroots', - name: 'wlroots', + subdirs: '@0@'.format(meson.project_name()), + version: meson.project_version(), + filebase: meson.project_name(), + name: meson.project_name(), description: 'Wayland compositor library', ) -- cgit v1.2.3 From 48ecbff691c4d462af6aa4f345823baea67c18fd Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Wed, 27 Dec 2017 16:17:09 +0100 Subject: include: Generate and install version-header --- include/wlr/meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'include/wlr') diff --git a/include/wlr/meson.build b/include/wlr/meson.build index eb0248d7..770673eb 100644 --- a/include/wlr/meson.build +++ b/include/wlr/meson.build @@ -1,2 +1,11 @@ +version_array = meson.project_version().split('.') +version_data = configuration_data() +version_data.set_quoted('WLR_VERSION_STR', meson.project_version()) +version_data.set('WLR_VERSION_MAJOR', version_array[0]) +version_data.set('WLR_VERSION_MINOR', version_array[1]) +version_data.set('WLR_VERSION_MICRO', version_array[2]) +version_data.set('WLR_VERSION_NUM', '(WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO') + header_install_dir = 'include/@0@/wlr'.format(meson.project_name()) -configure_file(output: 'config.h', install_dir: header_install_dir, configuration: conf_data) +configure_file(output: 'config.h', install_dir: header_install_dir, configuration: conf_data) +configure_file(output: 'version.h', install_dir: header_install_dir, configuration: version_data) -- cgit v1.2.3 From 71e42dae909c8e94f82873f9eee0c50f0284fbdd Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Wed, 27 Dec 2017 17:06:52 +0100 Subject: libwlroots: Add shared library versioning --- include/wlr/meson.build | 13 ++++++++----- meson.build | 8 +++++++- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'include/wlr') diff --git a/include/wlr/meson.build b/include/wlr/meson.build index 770673eb..84dc5ae9 100644 --- a/include/wlr/meson.build +++ b/include/wlr/meson.build @@ -1,10 +1,13 @@ version_array = meson.project_version().split('.') version_data = configuration_data() -version_data.set_quoted('WLR_VERSION_STR', meson.project_version()) -version_data.set('WLR_VERSION_MAJOR', version_array[0]) -version_data.set('WLR_VERSION_MINOR', version_array[1]) -version_data.set('WLR_VERSION_MICRO', version_array[2]) -version_data.set('WLR_VERSION_NUM', '(WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO') +version_data.set_quoted('WLR_VERSION_STR', meson.project_version()) +version_data.set('WLR_VERSION_MAJOR', version_array[0]) +version_data.set('WLR_VERSION_MINOR', version_array[1]) +version_data.set('WLR_VERSION_MICRO', version_array[2]) +version_data.set('WLR_VERSION_NUM', '(WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO') +version_data.set('WLR_VERSION_API_CURRENT', so_version[0]) +version_data.set('WLR_VERSION_API_REVISION', so_version[1]) +version_data.set('WLR_VERSION_API_AGE', so_version[2]) header_install_dir = 'include/@0@/wlr'.format(meson.project_name()) configure_file(output: 'config.h', install_dir: header_install_dir, configuration: conf_data) diff --git a/meson.build b/meson.build index 7d4997ad..52a6b584 100644 --- a/meson.build +++ b/meson.build @@ -11,6 +11,11 @@ project( ], ) +# Format of so_version is CURRENT, REVISION, AGE. +# See: https://autotools.io/libtool/version.html +# for a reference about clean library versioning. +so_version = ['0', '0', '0'] + add_project_arguments('-Wno-unused-parameter', language: 'c') add_project_arguments( '-DWLR_SRC_DIR="@0@"'.format(meson.source_root()), @@ -137,7 +142,8 @@ wlr_deps = [ ] lib_wlr = library( - 'wlroots', + meson.project_name(), + version: '.'.join(so_version), link_whole: wlr_parts, dependencies: wlr_deps, include_directories: wlr_inc, -- cgit v1.2.3