diff --git a/backend/session/direct-ipc.c b/backend/session/direct-ipc.c index 52cdbbb9..e7a169fa 100644 --- a/backend/session/direct-ipc.c +++ b/backend/session/direct-ipc.c @@ -18,7 +18,7 @@ #include #endif #include -#include "config.h" +#include #include #include "backend/session/direct-ipc.h" diff --git a/backend/session/logind.c b/backend/session/logind.c index 539490de..fb2af492 100644 --- a/backend/session/logind.c +++ b/backend/session/logind.c @@ -10,7 +10,7 @@ #include #include #include -#include "config.h" +#include #include #include diff --git a/backend/session/session.c b/backend/session/session.c index 725aa1b9..13d47579 100644 --- a/backend/session/session.c +++ b/backend/session/session.c @@ -9,7 +9,7 @@ #include #include #include -#include "config.h" +#include #include #include #include diff --git a/examples/support/config.c b/examples/support/config.c index ff63b078..f0efa594 100644 --- a/examples/support/config.c +++ b/examples/support/config.c @@ -7,9 +7,10 @@ #include #include #include -#include "config.h" +#include #include #include +#include "support/config.h" #include "shared.h" #include "ini.h" diff --git a/include/meson.build b/include/meson.build new file mode 100644 index 00000000..d16d6ef4 --- /dev/null +++ b/include/meson.build @@ -0,0 +1 @@ +subdir('wlr') diff --git a/include/rootston/desktop.h b/include/rootston/desktop.h index 7039cfcf..a016bb94 100644 --- a/include/rootston/desktop.h +++ b/include/rootston/desktop.h @@ -2,7 +2,7 @@ #define _ROOTSTON_DESKTOP_H #include #include -#include "config.h" +#include #include #include #include diff --git a/include/rootston/server.h b/include/rootston/server.h index a014c749..0c26ea92 100644 --- a/include/rootston/server.h +++ b/include/rootston/server.h @@ -1,7 +1,7 @@ #ifndef _ROOTSTON_SERVER_H #define _ROOTSTON_SERVER_H #include -#include "config.h" +#include #include #include #include diff --git a/include/rootston/view.h b/include/rootston/view.h index 53e96764..579b148a 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -2,7 +2,7 @@ #define _ROOTSTON_VIEW_H #include -#include "config.h" +#include #include #include #include diff --git a/include/wlr/meson.build b/include/wlr/meson.build new file mode 100644 index 00000000..84dc5ae9 --- /dev/null +++ b/include/wlr/meson.build @@ -0,0 +1,14 @@ +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('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) +configure_file(output: 'version.h', install_dir: header_install_dir, configuration: version_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 diff --git a/meson.build b/meson.build index 51de7a4c..52a6b584 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: [ @@ -10,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()), @@ -80,19 +86,24 @@ 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 -configure_file(output: 'config.h', install_dir: 'include/wlr', configuration: conf_data) -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') subdir('protocol') subdir('render') subdir('backend') @@ -131,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, @@ -150,8 +162,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', ) diff --git a/rootston/config.c b/rootston/config.c index f369c4f5..f9fde369 100644 --- a/rootston/config.c +++ b/rootston/config.c @@ -9,7 +9,7 @@ #include #include #include -#include "config.h" +#include #include #include #include "rootston/config.h" diff --git a/rootston/desktop.c b/rootston/desktop.c index a4692439..69dcf4a9 100644 --- a/rootston/desktop.c +++ b/rootston/desktop.c @@ -3,7 +3,7 @@ #include #include #include -#include "config.h" +#include #include #include #include diff --git a/rootston/main.c b/rootston/main.c index 87f1c0b4..33ca6504 100644 --- a/rootston/main.c +++ b/rootston/main.c @@ -3,7 +3,7 @@ #include #include #include -#include "config.h" +#include #include #include #include diff --git a/rootston/seat.c b/rootston/seat.c index 635bc8b1..c2c7e3ea 100644 --- a/rootston/seat.c +++ b/rootston/seat.c @@ -2,7 +2,7 @@ #include #include #include -#include "config.h" +#include #include #include #include "rootston/xcursor.h" diff --git a/rootston/xwayland.c b/rootston/xwayland.c index b00b61bc..3d84dc19 100644 --- a/rootston/xwayland.c +++ b/rootston/xwayland.c @@ -2,7 +2,7 @@ #include #include #include -#include "config.h" +#include #include #include #include diff --git a/types/wlr_xdg_shell_v6.c b/types/wlr_xdg_shell_v6.c index 3d9dc404..ead5a73e 100644 --- a/types/wlr_xdg_shell_v6.c +++ b/types/wlr_xdg_shell_v6.c @@ -5,7 +5,7 @@ #include #include #include -#include "config.h" +#include #include #include #include diff --git a/xwayland/xwm.c b/xwayland/xwm.c index d9bfaf2e..849acff8 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -7,7 +7,7 @@ #include #include #include -#include "config.h" +#include #include "wlr/util/log.h" #include "wlr/util/edges.h" #include "wlr/types/wlr_surface.h"