Revert "Merge pull request #1194 from ascent12/meson_feature"

This breaks wlroots when used as a meson subproject.

This reverts commit dea311992e, reversing
changes made to 6db9c4b746.
This commit is contained in:
Drew DeVault 2018-08-23 21:00:58 -04:00
parent dea311992e
commit 9c886f20b9
19 changed files with 227 additions and 385 deletions

View File

@ -1,4 +1,3 @@
backend_parts = []
backend_files = files( backend_files = files(
'backend.c', 'backend.c',
'drm/atomic.c', 'drm/atomic.c',
@ -45,17 +44,28 @@ else
backend_files += files('session/direct.c') backend_files += files('session/direct.c')
endif endif
if logind.found() if conf_data.get('WLR_HAS_SYSTEMD', false)
backend_files += files('session/logind.c') backend_files += files('session/logind.c')
backend_deps += logind backend_deps += systemd
endif endif
subdir('x11') if conf_data.get('WLR_HAS_X11_BACKEND', false)
backend_files += files(
'x11/backend.c',
'x11/input_device.c',
'x11/output.c',
)
backend_deps += xcb_xkb
endif
if conf_data.get('WLR_HAS_ELOGIND', false)
backend_files += files('session/logind.c')
backend_deps += elogind
endif
lib_wlr_backend = static_library( lib_wlr_backend = static_library(
'wlr_backend', 'wlr_backend',
backend_files, backend_files,
include_directories: wlr_inc, include_directories: wlr_inc,
link_whole: backend_parts,
dependencies: backend_deps, dependencies: backend_deps,
) )

View File

@ -1,44 +0,0 @@
x11_libs = []
x11_required = [
'xcb',
'x11-xcb',
]
x11_optional = [
'xcb-xkb',
]
foreach lib : x11_required
dep = dependency(lib, required: get_option('x11-backend'))
if not dep.found()
subdir_done()
endif
x11_libs += dep
endforeach
foreach lib : x11_optional
dep = dependency(lib, required: get_option(lib))
if dep.found()
x11_libs += dep
conf_data.set('WLR_HAS_' + lib.underscorify().to_upper(), true)
endif
endforeach
lib_wlr_backend_x11 = static_library(
'wlr_backend_x11',
files(
'backend.c',
'input_device.c',
'output.c',
),
include_directories: wlr_inc,
dependencies: [
wayland_server,
pixman,
xkbcommon,
x11_libs,
],
)
backend_parts += lib_wlr_backend_x11
conf_data.set('WLR_HAS_X11_BACKEND', true)

View File

@ -1,102 +1,80 @@
threads = dependency('threads') threads = dependency('threads')
wayland_cursor = dependency('wayland-cursor') wayland_cursor = dependency('wayland-cursor')
libpng = dependency('libpng', required: false) libpng = dependency('libpng', required: false)
# These versions correspond to ffmpeg 4.0 # These versions correspond to ffmpeg 4.0
libavutil = dependency('libavutil', version: '>=56.14.100', required: false) libavutil = dependency('libavutil', version: '>=56.14.100', required: false)
libavcodec = dependency('libavcodec', version: '>=58.18.100', required: false) libavcodec = dependency('libavcodec', version: '>=58.18.100', required: false)
libavformat = dependency('libavformat', version: '>=58.12.100', required: false) libavformat = dependency('libavformat', version: '>=58.12.100', required: false)
# Small hack until https://github.com/mesonbuild/meson/pull/3386/ is merged
foreach dep : ['libpng', 'libavutil', 'libavcodec', 'libavformat']
if not get_variable(dep).found()
set_variable(dep, disabler())
endif
endforeach
if not cc.has_header('libavutil/hwcontext_drm.h', dependencies: libavutil) if not cc.has_header('libavutil/hwcontext_drm.h', dependencies: libavutil)
libavutil = disabler() libavutil = disabler()
endif endif
examples = { executable('simple', 'simple.c', dependencies: wlroots)
'simple': { executable('pointer', 'pointer.c', dependencies: wlroots)
'src': 'simple.c', executable('touch', 'touch.c', 'cat.c', dependencies: wlroots)
'dep': wlroots, executable('tablet', 'tablet.c', dependencies: wlroots)
}, executable('rotation', 'rotation.c', 'cat.c', dependencies: wlroots)
'pointer': { executable('multi-pointer', 'multi-pointer.c', dependencies: wlroots)
'src': 'pointer.c', executable('output-layout', 'output-layout.c', 'cat.c', dependencies: wlroots)
'dep': wlroots,
},
'touch': {
'src': ['touch.c', 'cat.c'],
'dep': wlroots,
},
'tablet': {
'src': 'tablet.c',
'dep': wlroots,
},
'rotation': {
'src': ['rotation.c', 'cat.c'],
'dep': wlroots,
},
'multi-pointer': {
'src': 'multi-pointer.c',
'dep': wlroots,
},
'output-layout': {
'src': ['output-layout.c', 'cat.c'],
'dep': wlroots,
},
'screenshot': {
'src': 'screenshot.c',
'dep': [wayland_client, wlr_protos, wlroots],
},
'idle': {
'src': 'idle.c',
'dep': [wayland_client, wlr_protos, wlroots, threads],
},
'idle-inhibit': {
'src': 'idle-inhibit.c',
'dep': [wayland_client, wlr_protos, wlroots],
},
'layer-shell': {
'src': 'layer-shell.c',
'dep': [wayland_client, wayland_cursor, wlr_protos, wlroots],
},
'input-inhibitor': {
'src': 'input-inhibitor.c',
'dep': [wayland_client, wayland_cursor, wlr_protos, wlroots],
},
'gamma-control': {
'src': 'gamma-control.c',
'dep': [wayland_client, wayland_cursor, wlr_protos, wlroots],
},
'dmabuf-capture': {
'src': 'dmabuf-capture.c',
'dep': [
libavcodec,
libavformat,
libavutil,
threads,
wayland_client,
wlr_protos,
wlroots,
],
},
'screencopy': {
'src': 'screencopy.c',
'dep': [libpng, wayland_client, wlr_protos, wlroots],
},
'toplevel-decoration': {
'src': 'toplevel-decoration.c',
'dep': [wayland_client, wlr_protos, wlroots],
},
}
foreach name, info : examples
executable( executable(
name, 'screenshot',
info.get('src'), 'screenshot.c',
dependencies: info.get('dep'), dependencies: [wayland_client, wlr_protos, wlroots]
build_by_default: get_option('examples'), )
executable(
'idle',
'idle.c',
dependencies: [wayland_client, wlr_protos, wlroots, threads]
)
executable(
'idle-inhibit',
'idle-inhibit.c',
dependencies: [wayland_client, wlr_protos, wlroots, threads]
)
executable(
'layer-shell',
'layer-shell.c',
dependencies: [wayland_cursor, wayland_client, wlr_protos, wlroots]
)
executable(
'input-inhibitor',
'input-inhibitor.c',
dependencies: [wayland_cursor, wayland_client, wlr_protos, wlroots]
)
executable(
'gamma-control',
'gamma-control.c',
dependencies: [wayland_cursor, wayland_client, wlr_protos, wlroots]
)
if libavutil.found() and libavcodec.found() and libavformat.found()
executable(
'dmabuf-capture',
'dmabuf-capture.c',
dependencies: [wayland_client, wlr_protos, libavutil, libavcodec,
libavformat, wlroots, threads ]
)
endif
if libpng.found()
executable(
'screencopy',
'screencopy.c',
dependencies: [wayland_client, wlr_protos, wlroots, libpng]
)
endif
executable(
'toplevel-decoration',
'toplevel-decoration.c',
dependencies: [wayland_client, wlr_protos, wlroots]
) )
endforeach

View File

@ -66,6 +66,7 @@ cat > $OUT_H << EOF
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <EGL/eglmesaext.h>
#include <GLES2/gl2.h> #include <GLES2/gl2.h>
#include <GLES2/gl2ext.h> #include <GLES2/gl2ext.h>

View File

@ -1,16 +0,0 @@
install_headers(
'drm.h',
'headless.h',
'interface.h',
'libinput.h',
'multi.h',
'session.h',
'wayland.h',
subdir: 'wlr/backend',
)
if conf_data.get('WLR_HAS_X11_BACKEND', false)
install_headers('x11.h', subdir: 'wlr/backend')
endif
subdir('session')

View File

@ -1 +0,0 @@
install_headers('interface.h', subdir: 'wlr/backend/session')

View File

@ -1,19 +0,0 @@
#ifndef WLR_CONFIG_H
#define WLR_CONFIG_H
#mesondefine WLR_HAS_LIBCAP
#mesondefine WLR_HAS_SYSTEMD
#mesondefine WLR_HAS_ELOGIND
#mesondefine WLR_HAS_X11_BACKEND
#mesondefine WLR_HAS_XWAYLAND
#mesondefine WLR_HAS_XCB_ERRORS
#mesondefine WLR_HAS_XCB_ICCCM
#mesondefine WLR_HAS_XCB_XKB
#mesondefine WLR_HAS_POSIX_FALLOCATE
#endif

View File

@ -1,10 +0,0 @@
install_headers(
'wlr_input_device.h',
'wlr_keyboard.h',
'wlr_output.h',
'wlr_pointer.h',
'wlr_tablet_pad.h',
'wlr_tablet_tool.h',
'wlr_touch.h',
subdir: 'wlr/interfaces',
)

View File

@ -4,23 +4,11 @@ version_data.set_quoted('WLR_VERSION_STR', meson.project_version())
version_data.set('WLR_VERSION_MAJOR', version_array[0]) version_data.set('WLR_VERSION_MAJOR', version_array[0])
version_data.set('WLR_VERSION_MINOR', version_array[1]) version_data.set('WLR_VERSION_MINOR', version_array[1])
version_data.set('WLR_VERSION_MICRO', version_array[2]) 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_CURRENT', so_version[0])
version_data.set('WLR_VERSION_API_REVISION', so_version[1]) version_data.set('WLR_VERSION_API_REVISION', so_version[1])
version_data.set('WLR_VERSION_API_AGE', so_version[2]) version_data.set('WLR_VERSION_API_AGE', so_version[2])
install_headers( wlr_inc_dest = join_paths(get_option('includedir'), 'wlr')
configure_file(input: 'config.h.in', output: 'config.h',configuration: conf_data), configure_file(output: 'config.h', install_dir: wlr_inc_dest, configuration: conf_data)
configure_file(input: 'version.h.in', output: 'version.h', configuration: version_data), configure_file(output: 'version.h', install_dir: wlr_inc_dest, configuration: version_data)
'backend.h',
'xcursor.h',
subdir: 'wlr'
)
if conf_data.get('WLR_HAS_XWAYLAND', false)
install_headers('xwayland.h', subdir: 'wlr')
endif
subdir('backend')
subdir('interfaces')
subdir('render')
subdir('types')
subdir('util')

View File

@ -1,9 +0,0 @@
install_headers(
'dmabuf.h',
'egl.h',
'gles2.h',
'interface.h',
'wlr_renderer.h',
'wlr_texture.h',
subdir: 'wlr/render'
)

View File

@ -1,42 +0,0 @@
install_headers(
'wlr_box.h',
'wlr_buffer.h',
'wlr_compositor.h',
'wlr_cursor.h',
'wlr_data_device.h',
'wlr_export_dmabuf_v1.h',
'wlr_gamma_control.h',
'wlr_gamma_control_v1.h',
'wlr_idle.h',
'wlr_idle_inhibit_v1.h',
'wlr_input_device.h',
'wlr_input_inhibitor.h',
'wlr_keyboard.h',
'wlr_layer_shell.h',
'wlr_linux_dmabuf_v1.h',
'wlr_list.h',
'wlr_matrix.h',
'wlr_output.h',
'wlr_output_damage.h',
'wlr_output_layout.h',
'wlr_pointer.h',
'wlr_primary_selection.h',
'wlr_region.h',
'wlr_screencopy_v1.h',
'wlr_screenshooter.h',
'wlr_seat.h',
'wlr_server_decoration.h',
'wlr_surface.h',
'wlr_tablet_pad.h',
'wlr_tablet_tool.h',
'wlr_tablet_v2.h',
'wlr_touch.h',
'wlr_virtual_keyboard_v1.h',
'wlr_wl_shell.h',
'wlr_xcursor_manager.h',
'wlr_xdg_decoration_v1.h',
'wlr_xdg_output.h',
'wlr_xdg_shell.h',
'wlr_xdg_shell_v6.h',
subdir: 'wlr/types',
)

View File

@ -1,6 +0,0 @@
install_headers(
'edges.h',
'log.h',
'region.h',
subdir: 'wlr/util',
)

View File

@ -1,16 +0,0 @@
#ifndef WLR_VERSION_H
#define WLR_VERSION_H
#mesondefine WLR_VERSION_STR
#mesondefine WLR_VERSION_MAJOR
#mesondefine WLR_VERSION_MINOR
#mesondefine WLR_VERSION_MICRO
#define WLR_VERSION_NUM ((WLR_VERSION_MAJOR << 16) | (WLR_VERSION_MINOR << 8) | WLR_VERSION_MICRO)
#mesondefine WLR_VERSION_API_CURRENT
#mesondefine WLR_VERSION_API_REVISION
#mesondefine WLR_VERSION_API_AGE
#endif

View File

@ -3,7 +3,7 @@ project(
'c', 'c',
version: '0.0.1', version: '0.0.1',
license: 'MIT', license: 'MIT',
meson_version: '>=0.47.0', meson_version: '>=0.44.0',
default_options: [ default_options: [
'c_std=c11', 'c_std=c11',
'warning_level=2', 'warning_level=2',
@ -18,7 +18,15 @@ so_version = ['0', '0', '0']
add_project_arguments('-Wno-unused-parameter', language: 'c') add_project_arguments('-Wno-unused-parameter', language: 'c')
add_project_arguments( add_project_arguments(
'-DWLR_SRC_DIR="@0@"'.format(meson.current_source_dir()), '-DWLR_SRC_DIR="@0@"'.format(meson.source_root()),
language: 'c',
)
add_project_arguments(
'-I@0@'.format(meson.build_root()),
language: 'c',
)
add_project_link_arguments(
'-Wl,-rpath,@0@'.format(meson.build_root()),
language: 'c', language: 'c',
) )
add_project_arguments( add_project_arguments(
@ -28,7 +36,7 @@ add_project_arguments(
conf_data = configuration_data() conf_data = configuration_data()
wlr_inc = include_directories('.', 'include') wlr_inc = include_directories('include')
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
@ -54,37 +62,90 @@ libinput = dependency('libinput', version: '>=1.7.0')
xkbcommon = dependency('xkbcommon') xkbcommon = dependency('xkbcommon')
udev = dependency('libudev') udev = dependency('libudev')
pixman = dependency('pixman-1') pixman = dependency('pixman-1')
libcap = dependency('libcap', required: get_option('libcap')) libcap = dependency('libcap', required: get_option('enable-libcap') == 'true')
logind = dependency('lib' + get_option('logind-provider'), required: get_option('logind')) systemd = dependency('libsystemd', required: get_option('enable-systemd') == 'true')
elogind = dependency('libelogind', required: get_option('enable-elogind') == 'true')
math = cc.find_library('m', required: false) math = cc.find_library('m', required: false)
exclude_headers = []
wlr_parts = [] wlr_parts = []
wlr_deps = [] wlr_deps = []
if libcap.found() if libcap.found() and get_option('enable-libcap') != 'false'
conf_data.set('WLR_HAS_LIBCAP', true) conf_data.set('WLR_HAS_LIBCAP', true)
wlr_deps += libcap wlr_deps += libcap
endif endif
if logind.found() if systemd.found() and get_option('enable-systemd') != 'false'
conf_data.set('WLR_HAS_' + get_option('logind-provider').to_upper(), true) conf_data.set('WLR_HAS_SYSTEMD', true)
wlr_deps += logind wlr_deps += systemd
endif
if elogind.found() and get_option('enable-elogind') != 'false'
conf_data.set('WLR_HAS_ELOGIND', true)
endif
if get_option('enable-x11_backend') or get_option('enable-xwayland')
xcb = dependency('xcb')
xcb_composite = dependency('xcb-composite')
xcb_xfixes = dependency('xcb-xfixes')
xcb_image = dependency('xcb-image')
xcb_render = dependency('xcb-render')
x11_xcb = dependency('x11-xcb')
xcb_icccm = dependency('xcb-icccm', required: false)
xcb_xkb = dependency('xcb-xkb', required: false)
xcb_errors = dependency('xcb-errors', required: get_option('enable-xcb_errors') == 'true')
if xcb_icccm.found()
conf_data.set('WLR_HAS_XCB_ICCCM', true)
endif
if xcb_xkb.found()
conf_data.set('WLR_HAS_XCB_XKB', true)
endif
if xcb_errors.found() and get_option('enable-xcb_errors') != 'false'
conf_data.set('WLR_HAS_XCB_ERRORS', true)
endif
wlr_deps += [
xcb,
xcb_composite,
x11_xcb,
]
else
add_project_arguments('-DMESA_EGL_NO_X11_HEADERS', language: 'c')
endif
if get_option('enable-x11_backend')
conf_data.set('WLR_HAS_X11_BACKEND', true)
endif
if get_option('enable-xwayland')
subdir('xwayland')
wlr_parts += [lib_wlr_xwayland]
conf_data.set('WLR_HAS_XWAYLAND', true)
else
exclude_headers += 'xwayland.h'
endif endif
if cc.has_header_symbol('fcntl.h', 'posix_fallocate', prefix: '#define _POSIX_C_SOURCE 200112L') if cc.has_header_symbol('fcntl.h', 'posix_fallocate', prefix: '#define _POSIX_C_SOURCE 200112L')
conf_data.set('WLR_HAS_POSIX_FALLOCATE', true) conf_data.set('WLR_HAS_POSIX_FALLOCATE', true)
endif endif
includedir = get_option('includedir')
exclude_headers += 'meson.build'
install_subdir('include/wlr', install_dir: includedir, exclude_files: exclude_headers)
subdir('include')
subdir('protocol') subdir('protocol')
subdir('render') subdir('render')
subdir('backend') subdir('backend')
subdir('types') subdir('types')
subdir('util') subdir('util')
subdir('xcursor') subdir('xcursor')
subdir('xwayland')
subdir('include')
wlr_parts += [ wlr_parts += [
lib_wl_protos, lib_wl_protos,
@ -121,7 +182,6 @@ lib_wlr = library(
include_directories: wlr_inc, include_directories: wlr_inc,
install: true, install: true,
link_args : symbols_flag, link_args : symbols_flag,
link_depends: symbols_file,
) )
wlroots = declare_dependency( wlroots = declare_dependency(
@ -130,6 +190,7 @@ wlroots = declare_dependency(
include_directories: wlr_inc, include_directories: wlr_inc,
) )
summary = [ summary = [
'', '',
'----------------', '----------------',
@ -147,8 +208,14 @@ summary = [
] ]
message('\n'.join(summary)) message('\n'.join(summary))
subdir('examples')
if get_option('enable-rootston')
subdir('rootston') subdir('rootston')
endif
if get_option('enable-examples')
subdir('examples')
endif
pkgconfig = import('pkgconfig') pkgconfig = import('pkgconfig')
pkgconfig.generate( pkgconfig.generate(
@ -163,31 +230,26 @@ git = find_program('git', required: false)
if git.found() if git.found()
all_files = run_command( all_files = run_command(
git, git,
'--git-dir=@0@/.git'.format(meson.current_source_dir()), ['--git-dir=@0@/.git'.format(meson.current_source_dir()),
'ls-files', 'ls-files',
':/*.[ch]', ':/*.[ch]'])
)
all_files = files(all_files.stdout().split()) all_files = files(all_files.stdout().split())
etags = find_program('etags', required: false) etags = find_program('etags', required: false)
if etags.found() and all_files.length() > 0 if etags.found() and all_files.length() > 0
custom_target( custom_target('etags',
'etags',
build_by_default: true, build_by_default: true,
input: all_files, input: all_files,
output: 'TAGS', output: 'TAGS',
command: [etags, '-o', '@OUTPUT@', '@INPUT@'], command: [etags.path(), '-o', 'TAGS'] + all_files)
)
endif endif
ctags = find_program('ctags', required: false) ctags = find_program('ctags', required: false)
if ctags.found() and all_files.length() > 0 if ctags.found() and all_files.length() > 0
custom_target( custom_target('ctags',
'ctags',
build_by_default: true, build_by_default: true,
input: all_files, input: all_files,
output: 'tags', output: 'tags',
command: [ctags, '-f', '@OUTPUT@', '@INPUT@'], command: [ctags.path(), '-f', 'tags'] + all_files)
)
endif endif
endif endif

View File

@ -1,10 +1,8 @@
option('libcap', type: 'feature', value: 'auto', description: 'Enable support for rootless session via capabilities (cap_sys_admin)') option('enable-libcap', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for capabilities')
option('logind', type: 'feature', value: 'auto', description: 'Enable support for rootless session via logind') option('enable-systemd', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for logind')
option('logind-provider', type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', description: 'Provider of logind support library') option('enable-elogind', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for logind')
option('xcb-errors', type: 'feature', value: 'auto', description: 'Use xcb-errors util library') option('enable-xcb_errors', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Use xcb-errors util library')
option('xcb-icccm', type: 'feature', value: 'auto', description: 'Use xcb-icccm util library') option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support X11 applications')
option('xcb-xkb', type: 'feature', value: 'auto', description: 'Use xcb-xkb util library') option('enable-x11_backend', type: 'boolean', value: true, description: 'Enable X11 backend')
option('xwayland', type: 'feature', value: 'auto', description: 'Enable support for X11 applications') option('enable-rootston', type: 'boolean', value: true, description: 'Build the rootston example compositor')
option('x11-backend', type: 'feature', value: 'auto', description: 'Enable X11 backend') option('enable-examples', type: 'boolean', value: true, description: 'Build example applications')
option('rootston', type: 'boolean', value: true, description: 'Build the rootston example compositor')
option('examples', type: 'boolean', value: true, description: 'Build example applications')

View File

@ -1,15 +1,32 @@
wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir') wl_protocol_dir = wayland_protos.get_pkgconfig_variable('pkgdatadir')
wayland_scanner_dep = dependency('wayland-scanner', required: false, native: true) wayland_scanner = find_program('wayland-scanner')
if wayland_scanner_dep.found()
wayland_scanner = find_program( wayland_scanner_server = generator(
wayland_scanner_dep.get_pkgconfig_variable('wayland_scanner'), wayland_scanner,
native: true, output: '@BASENAME@-protocol.h',
arguments: ['server-header', '@INPUT@', '@OUTPUT@'],
) )
# should check wayland_scanner's version, but it is hard to get
if wayland_server.version().version_compare('>=1.14.91')
code_type = 'private-code'
else else
wayland_scanner = find_program('wayland-scanner', native: true) code_type = 'code'
endif endif
wayland_scanner_code = generator(
wayland_scanner,
output: '@BASENAME@-protocol.c',
arguments: [code_type, '@INPUT@', '@OUTPUT@'],
)
wayland_scanner_client = generator(
wayland_scanner,
output: '@BASENAME@-client-protocol.h',
arguments: ['client-header', '@INPUT@', '@OUTPUT@'],
)
protocols = [ protocols = [
[wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'], [wl_protocol_dir, 'stable/xdg-shell/xdg-shell.xml'],
[wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'], [wl_protocol_dir, 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'],
@ -50,35 +67,17 @@ wl_protos_headers = []
foreach p : protocols foreach p : protocols
xml = join_paths(p) xml = join_paths(p)
wl_protos_src += custom_target( wl_protos_src += wayland_scanner_code.process(xml)
xml.underscorify() + '_server_c', wl_protos_headers += wayland_scanner_server.process(xml)
input: xml,
output: '@BASENAME@-protocol.c',
command: [wayland_scanner, 'private-code', '@INPUT@', '@OUTPUT@'],
)
wl_protos_headers += custom_target(
xml.underscorify() + '_server_h',
input: xml,
output: '@BASENAME@-protocol.h',
command: [wayland_scanner, 'server-header', '@INPUT@', '@OUTPUT@'],
)
endforeach endforeach
foreach p : client_protocols foreach p : client_protocols
xml = join_paths(p) xml = join_paths(p)
wl_protos_headers += custom_target( wl_protos_headers += wayland_scanner_client.process(xml)
xml.underscorify() + '_client_h',
input: xml,
output: '@BASENAME@-client-protocol.h',
command: [wayland_scanner, 'client-header', '@INPUT@', '@OUTPUT@'],
)
endforeach endforeach
lib_wl_protos = static_library( lib_wl_protos = static_library('wl_protos', wl_protos_src + wl_protos_headers,
'wl_protos', dependencies: [wayland_client]) # for the include directory
wl_protos_src + wl_protos_headers,
dependencies: wayland_client.partial_dependency(includes: true),
)
wlr_protos = declare_dependency( wlr_protos = declare_dependency(
link_with: lib_wl_protos, link_with: lib_wl_protos,

View File

@ -1,7 +1,6 @@
glgen = find_program('../glgen.sh') glgen = find_program('../glgen.sh')
glapi = custom_target( glapi = custom_target('glapi',
'glapi',
input: 'glapi.txt', input: 'glapi.txt',
output: ['@BASENAME@.c', '@BASENAME@.h'], output: ['@BASENAME@.c', '@BASENAME@.h'],
command: [glgen, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@'], command: [glgen, '@INPUT@', '@OUTPUT0@', '@OUTPUT1@'],
@ -20,7 +19,8 @@ lib_wlr_render = static_library(
'wlr_renderer.c', 'wlr_renderer.c',
'wlr_texture.c', 'wlr_texture.c',
), ),
glapi, glapi[0],
glapi[1],
include_directories: wlr_inc, include_directories: wlr_inc,
dependencies: [egl, glesv2, pixman, wayland_server], dependencies: [egl, glesv2, pixman, wayland_server],
) )

View File

@ -11,17 +11,12 @@ sources = [
'seat.c', 'seat.c',
'virtual_keyboard.c', 'virtual_keyboard.c',
'wl_shell.c', 'wl_shell.c',
'xdg_shell.c',
'xdg_shell_v6.c', 'xdg_shell_v6.c',
'xdg_shell.c',
] ]
if get_option('enable-xwayland')
if conf_data.get('WLR_HAS_XWAYLAND', false) sources += ['xwayland.c']
sources += 'xwayland.c'
endif endif
executable( executable(
'rootston', 'rootston', sources, dependencies: [wlroots, wlr_protos, pixman]
sources,
dependencies: [wlroots, wlr_protos, pixman],
build_by_default: get_option('rootston'),
) )

View File

@ -1,32 +1,3 @@
xwayland_libs = []
xwayland_required = [
'xcb',
'xcb-composite',
'xcb-render',
'xcb-xfixes',
]
xwayland_optional = [
'xcb-errors',
'xcb-icccm',
]
foreach lib : xwayland_required
dep = dependency(lib, required: get_option('xwayland'))
if not dep.found()
subdir_done()
endif
xwayland_libs += dep
endforeach
foreach lib : xwayland_optional
dep = dependency(lib, required: get_option(lib))
if dep.found()
xwayland_libs += dep
conf_data.set('WLR_HAS_' + lib.underscorify().to_upper(), true)
endif
endforeach
lib_wlr_xwayland = static_library( lib_wlr_xwayland = static_library(
'wlr_xwayland', 'wlr_xwayland',
files( files(
@ -41,11 +12,14 @@ lib_wlr_xwayland = static_library(
include_directories: wlr_inc, include_directories: wlr_inc,
dependencies: [ dependencies: [
wayland_server, wayland_server,
xwayland_libs, xcb,
xcb_composite,
xcb_xfixes,
xcb_image,
xcb_render,
xcb_icccm,
xcb_errors,
xkbcommon, xkbcommon,
pixman, pixman,
], ],
) )
wlr_parts += lib_wlr_xwayland
conf_data.set('WLR_HAS_XWAYLAND', true)