diff --git a/libweston/backend-x11/meson.build b/libweston/backend-x11/meson.build new file mode 100644 index 00000000..6acee8ae --- /dev/null +++ b/libweston/backend-x11/meson.build @@ -0,0 +1,57 @@ + +if not get_option('backend-x11') + subdir_done() +endif + +config_h.set('BUILD_X11_COMPOSITOR', '1') + +srcs_x11 = [ + 'x11.c', + presentation_time_server_protocol_h, +] + +dep_x11_xcb = dependency('xcb', version: '>= 1.8', required: false) +if not dep_x11_xcb.found() + error('x11-backend requires xcb >= 1.8 which was not found. Or, you can use \'-Dbackend-x11=false\'.') +endif + +deps_x11 = [ + dep_libweston, + dep_x11_xcb, + dep_lib_cairo_shared, + dep_pixman, +] + +foreach name : [ 'xcb-shm', 'x11', 'x11-xcb' ] + d = dependency(name, required: false) + if not d.found() + error('x11-backend requires @0@ which was not found. Or, you can use \'-Dbackend-x11=false\'.'.format(name)) + endif + deps_x11 += d +endforeach + +dep_xcb_xkb = dependency('xcb-xkb', version: '>= 1.9', required: false) +if dep_xcb_xkb.found() + deps_x11 += dep_xcb_xkb + config_h.set('HAVE_XCB_XKB', '1') +endif + +if get_option('renderer-gl') + if not dep_egl.found() + error('x11-backend + gl-renderer requires egl which was not found. Or, you can use \'-Dbackend-x11=false\' or \'-Drenderer-gl=false\'.') + endif + deps_x11 += dep_egl +endif + +plugin_x11 = shared_library( + 'x11-backend', + srcs_x11, + include_directories: include_directories('../..', '../../shared'), + dependencies: deps_x11, + name_prefix: '', + install: true, + install_dir: dir_module_libweston +) +env_modmap += 'x11-backend.so=@0@;'.format(plugin_x11.full_path()) + +install_headers(backend_x11_h, subdir: dir_include_libweston_install) diff --git a/libweston/compositor-x11.c b/libweston/backend-x11/x11.c similarity index 100% rename from libweston/compositor-x11.c rename to libweston/backend-x11/x11.c diff --git a/libweston/meson.build b/libweston/meson.build index db3a911c..357a910b 100644 --- a/libweston/meson.build +++ b/libweston/meson.build @@ -185,62 +185,6 @@ dep_libinput_backend = declare_dependency( include_directories: include_directories('.') ) -if get_option('backend-x11') - config_h.set('BUILD_X11_COMPOSITOR', '1') - - srcs_x11 = [ - 'compositor-x11.c', - presentation_time_server_protocol_h, - ] - - dep_x11_xcb = dependency('xcb', version: '>= 1.8', required: false) - if not dep_x11_xcb.found() - error('x11-backend requires xcb >= 1.8 which was not found. Or, you can use \'-Dbackend-x11=false\'.') - endif - - deps_x11 = [ - dep_libweston, - dep_x11_xcb, - dep_lib_cairo_shared, - dep_pixman, - ] - - foreach name : [ 'xcb-shm', 'x11', 'x11-xcb' ] - d = dependency(name, required: false) - if not d.found() - error('x11-backend requires @0@ which was not found. Or, you can use \'-Dbackend-x11=false\'.'.format(name)) - endif - deps_x11 += d - endforeach - - dep_xcb_xkb = dependency('xcb-xkb', version: '>= 1.9', required: false) - if dep_xcb_xkb.found() - deps_x11 += dep_xcb_xkb - config_h.set('HAVE_XCB_XKB', '1') - endif - - if get_option('renderer-gl') - if not dep_egl.found() - error('x11-backend + gl-renderer requires egl which was not found. Or, you can use \'-Dbackend-x11=false\' or \'-Drenderer-gl=false\'.') - endif - deps_x11 += dep_egl - endif - - plugin_x11 = shared_library( - 'x11-backend', - srcs_x11, - include_directories: include_directories('..', '../shared'), - dependencies: deps_x11, - name_prefix: '', - install: true, - install_dir: dir_module_libweston - ) - env_modmap += 'x11-backend.so=@0@;'.format(plugin_x11.full_path()) - - install_headers(backend_x11_h, subdir: dir_include_libweston_install) -endif - - if get_option('backend-fbdev') config_h.set('BUILD_FBDEV_COMPOSITOR', '1') @@ -298,3 +242,4 @@ subdir('backend-drm') subdir('backend-headless') subdir('backend-rdp') subdir('backend-wayland') +subdir('backend-x11')