aboutsummaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorScott Anderson <scott@anderso.nz>2019-11-22 20:11:15 +1300
committerDrew DeVault <sir@cmpwn.com>2019-12-23 07:48:29 -0500
commitcff1c2f740a2f7d22339a0fae14c4923223a8d61 (patch)
treef1ecfe2a5345f3b1ef5b94260e909c5143fcd64d /meson.build
parentfc6c0ca12e941d5d7d567834bff3ab7df9447001 (diff)
meson: Various improvements
Bumps minimum version to 0.51.0 - Remove all intermediate static libraries. They serve no purpose and are just add a bunch of boilerplate for managing dependencies and options. It's now managed as a list of files which are compiled into libwlroots directly. - Use install_subdir instead of installing headers individually. I've changed my mind since I did that. Listing them out is annoying as hell, and it's easy to forget to do it. - Add not_found_message for all of our optional dependencies that have a meson option. It gives some hints about what option to pass and what the optional dependency is for. - Move all backend subdirectories into their own meson.build. This keeps some of the backend-specific build logic (especially rdp and session) more neatly separated off. - Don't overlink example clients with code they're not using. This was done by merging the protocol dictionaries and setting some variables containing the code and client header file. Example clients now explicitly mention what extension protocols they want to link to. - Split compositor example logic from client example logic. - Minor formatting changes
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build104
1 files changed, 39 insertions, 65 deletions
diff --git a/meson.build b/meson.build
index 18528df2..87af465e 100644
--- a/meson.build
+++ b/meson.build
@@ -3,7 +3,7 @@ project(
'c',
version: '0.8.1',
license: 'MIT',
- meson_version: '>=0.49.0',
+ meson_version: '>=0.51.0',
default_options: [
'c_std=c11',
'warning_level=2',
@@ -88,8 +88,6 @@ conf_data.set10('WLR_HAS_XWAYLAND', false)
conf_data.set10('WLR_HAS_XCB_ERRORS', false)
conf_data.set10('WLR_HAS_XCB_ICCCM', false)
-wlr_inc = include_directories('.', 'include')
-
# Clang complains about some zeroed initializer lists (= {0}), even though they
# are valid
if cc.get_id() == 'clang'
@@ -99,66 +97,21 @@ endif
wayland_server = dependency('wayland-server', version: '>=1.16')
wayland_client = dependency('wayland-client')
-wayland_egl = dependency('wayland-egl')
+wayland_egl = dependency('wayland-egl')
wayland_protos = dependency('wayland-protocols', version: '>=1.17')
-egl = dependency('egl')
-freerdp = dependency('freerdp2', required: get_option('freerdp'))
-winpr2 = dependency('winpr2', required: get_option('freerdp'))
-glesv2 = dependency('glesv2')
-drm = dependency('libdrm', version: '>=2.4.95')
-gbm = dependency('gbm', version: '>=17.1.0')
-libinput = dependency('libinput', version: '>=1.9.0')
-xkbcommon = dependency('xkbcommon')
-udev = dependency('libudev')
-pixman = dependency('pixman-1')
-libcap = dependency('libcap', required: get_option('libcap'))
-logind = dependency('lib' + get_option('logind-provider'), required: get_option('logind'), version: '>=237')
-math = cc.find_library('m')
-rt = cc.find_library('rt')
-
-wlr_parts = []
-wlr_deps = []
-
-if libcap.found()
- conf_data.set10('WLR_HAS_LIBCAP', true)
- wlr_deps += libcap
-endif
-
-if logind.found()
- conf_data.set10('WLR_HAS_' + get_option('logind-provider').to_upper(), true)
- wlr_deps += logind
-endif
-
-if libinput.found()
- ver = libinput.version().split('.')
- add_project_arguments([
- '-DLIBINPUT_MAJOR=' + ver[0],
- '-DLIBINPUT_MINOR=' + ver[1],
- '-DLIBINPUT_PATCH=' + ver[2],
- ], language: 'c')
-endif
-
-subdir('protocol')
-subdir('render')
-
-subdir('backend')
-subdir('types')
-subdir('util')
-subdir('xcursor')
-subdir('xwayland')
-
-subdir('include')
-
-wlr_parts += [
- lib_wl_protos,
- lib_wlr_backend,
- lib_wlr_render,
- lib_wlr_types,
- lib_wlr_util,
- lib_wlr_xcursor,
-]
-
-wlr_deps += [
+egl = dependency('egl')
+glesv2 = dependency('glesv2')
+drm = dependency('libdrm', version: '>=2.4.95')
+gbm = dependency('gbm', version: '>=17.1.0')
+libinput = dependency('libinput', version: '>=1.9.0')
+xkbcommon = dependency('xkbcommon')
+udev = dependency('libudev')
+pixman = dependency('pixman-1')
+math = cc.find_library('m')
+rt = cc.find_library('rt')
+
+wlr_files = []
+wlr_deps = [
wayland_server,
wayland_client,
wayland_egl,
@@ -172,16 +125,37 @@ wlr_deps += [
udev,
pixman,
math,
+ rt,
]
+libinput_ver = libinput.version().split('.')
+add_project_arguments([
+ '-DLIBINPUT_MAJOR=' + libinput_ver[0],
+ '-DLIBINPUT_MINOR=' + libinput_ver[1],
+ '-DLIBINPUT_PATCH=' + libinput_ver[2],
+], language: 'c')
+
+subdir('protocol')
+subdir('render')
+
+subdir('backend')
+subdir('types')
+subdir('util')
+subdir('xcursor')
+subdir('xwayland')
+
+subdir('include')
+
+wlr_inc = include_directories('.', 'include')
+proto_inc = include_directories('protocol')
+
symbols_file = 'wlroots.syms'
symbols_flag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbols_file)
lib_wlr = library(
- meson.project_name(),
+ meson.project_name(), wlr_files,
version: '.'.join(so_version),
- link_whole: wlr_parts,
dependencies: wlr_deps,
- include_directories: wlr_inc,
+ include_directories: [wlr_inc, proto_inc],
install: true,
link_args : symbols_flag,
link_depends: symbols_file,