diff --git a/gdk/broadway/meson.build b/gdk/broadway/meson.build new file mode 100644 index 0000000000..0e5b1c4312 --- /dev/null +++ b/gdk/broadway/meson.build @@ -0,0 +1,63 @@ +gdk_broadway_sources = files([ + 'broadway-buffer.c', + 'broadway-output.c', + 'broadway-server.c', + 'broadwayd.c', + 'gdkbroadway-server.c', + 'gdkcursor-broadway.c', + 'gdkdevice-broadway.c', + 'gdkdevicemanager-broadway.c', + 'gdkdisplay-broadway.c', + 'gdkdnd-broadway.c', + 'gdkeventsource.c', + 'gdkglobals-broadway.c', + 'gdkkeys-broadway.c', + 'gdkmonitor-broadway.c', + 'gdkproperty-broadway.c', + 'gdkscreen-broadway.c', + 'gdkselection-broadway.c', + 'gdkwindow-broadway.c', +]) + +gdk_broadway_public_headers = [ + 'gdkbroadwaydisplay.h', + 'gdkbroadwaywindow.h', + 'gdkbroadwaycursor.h', + 'gdkbroadwaymonitor.h', +] + +# Broadway backend headers aren't installed it seems +#install_headers(gdk_broadway_public_headers, subdir: 'gtk-4.0/gdk/broadway/') +#install_headers('gdkbroadway.h', subdir: 'gtk-4.0/gdk/') + +gdk_broadway_deps = [shmlib] + +libgdk_broadway = static_library('libgdk-broadway', + gdk_broadway_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], + dependencies: [gdk_deps, gdk_broadway_deps]) + +# gtk4-broadwayd + +broadwayd_syslib = os_win32 ? find_library('ws2_32') : shmlib + +clienthtml_h = custom_target('clienthtml.h', + input : 'client.html', + output : 'clienthtml.h', + command : [find_program('toarray.pl'), 'client_html', '@INPUT@'], + capture : true) + +broadwayjs_h = custom_target('broadwayjs.h', + input : ['broadway.js', 'rawinflate.min.js'], + output : 'broadwayjs.h', + command : [find_program('toarray.pl'), 'broadway_js', '@INPUT0@', '@INPUT1@'], + capture : true) + +executable('gtk4-broadwayd', + clienthtml_h, broadwayjs_h, + 'broadwayd.c', 'broadway-server.c', 'broadway-buffer.c', 'broadway-output.c', + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], + dependencies : [broadwayd_syslib, gdk_deps], + install : true) diff --git a/gdk/meson.build b/gdk/meson.build index c162c72a30..56a5fcc702 100644 --- a/gdk/meson.build +++ b/gdk/meson.build @@ -84,41 +84,6 @@ gdk_private_h_sources = files([ 'gdkseatdefaultprivate.h', ]) -gdk_broadway_sources = files([ - 'broadway/broadway-buffer.c', - 'broadway/broadway-buffer.h', - 'broadway/broadway-output.c', - 'broadway/broadway-output.h', - 'broadway/broadway-server.c', - 'broadway/broadway-server.h', - 'broadway/broadwayd.c', - 'broadway/gdkbroadway-server.c', - 'broadway/gdkcursor-broadway.c', - 'broadway/gdkdevice-broadway.c', - 'broadway/gdkdevice-broadway.h', - 'broadway/gdkdevicemanager-broadway.c', - 'broadway/gdkdevicemanager-broadway.h', - 'broadway/gdkdisplay-broadway.c', - 'broadway/gdkdisplay-broadway.h', - 'broadway/gdkdnd-broadway.c', - 'broadway/gdkeventsource.c', - 'broadway/gdkeventsource.h', - 'broadway/gdkglobals-broadway.c', - 'broadway/gdkkeys-broadway.c', - 'broadway/gdkmonitor-broadway.c', - 'broadway/gdkmonitor-broadway.h', - 'broadway/gdkproperty-broadway.c', - 'broadway/gdkscreen-broadway.c', - 'broadway/gdkscreen-broadway.h', - 'broadway/gdkselection-broadway.c', - 'broadway/gdkwindow-broadway.c', - 'broadway/gdkwindow-broadway.h', -]) - -gdk_broadway_private_sources = files([ - 'broadway/gdkprivate-broadway.h' -]) - gdk_gresource_xml = configure_file(output : 'gdk.gresource.xml', input : 'gen-gsk-resources-xml.py', command : [find_program('gen-gdk-gresources-xml.py'), @@ -172,6 +137,8 @@ gdkversionmacros = configure_file( configuration: gdkversion_cdata, install_dir: 'include/gtk-4.0/gdk/') +gdkinc = include_directories('.') + xinc = include_directories('x11') wlinc = include_directories('.') @@ -210,32 +177,20 @@ if wayland_enabled or broadway_enabled endif endif -if x11_enabled - subdir('x11') - gdk_deps += gdk_x11_deps - gdk_sources += gdk_x11_sources -endif - -if wayland_enabled - subdir('wayland') - gdk_deps += gdk_wayland_deps - gdk_sources += gdk_wayland_sources -endif - -if broadway_enabled - gdk_deps += [ - shmlib, - ] - gdk_sources += [ - gdk_broadway_sources, - gdk_broadway_private_sources - ] -endif +gdk_backends = [] +foreach backend : ['broadway', 'wayland', 'x11'] + if get_variable('@0@_enabled'.format(backend)) + subdir(backend) + gdk_deps += get_variable('gdk_@0@_deps'.format(backend)) + gdk_backends += get_variable('libgdk_@0@'.format(backend)) + endif +endforeach libgdk = static_library('gdk', sources: [gdk_sources, gdkconfig], c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], include_directories: [confinc, xinc, wlinc], + link_with: gdk_backends, dependencies: gdk_deps, ) diff --git a/gdk/wayland/gdkeventsource-wayland.c b/gdk/wayland/gdkeventsource-wayland.c deleted file mode 100644 index 7d03f7f629..0000000000 --- a/gdk/wayland/gdkeventsource-wayland.c +++ /dev/null @@ -1 +0,0 @@ -#include "gdkeventsource.c" diff --git a/gdk/wayland/meson.build b/gdk/wayland/meson.build index 5f4b1ba498..d1a96b620c 100644 --- a/gdk/wayland/meson.build +++ b/gdk/wayland/meson.build @@ -4,7 +4,7 @@ gdk_wayland_sources = files([ 'gdkdevice-wayland.c', 'gdkdisplay-wayland.c', 'gdkdnd-wayland.c', - 'gdkeventsource-wayland.c', + 'gdkeventsource.c', 'gdkglcontext-wayland.c', 'gdkkeys-wayland.c', 'gdkmonitor-wayland.c', @@ -79,3 +79,9 @@ foreach p : proto_sources output : '@0@-protocol.c'.format(output_base), command: [genprotocols, wayland_scanner, '@INPUT@', '@OUTPUT@', 'code']) endforeach + +libgdk_wayland = static_library('libgdk-wayland', + gdk_wayland_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], + dependencies: [gdk_deps, gdk_wayland_deps]) diff --git a/gdk/x11/meson.build b/gdk/x11/meson.build index 73af5a3279..298c5929e2 100644 --- a/gdk/x11/meson.build +++ b/gdk/x11/meson.build @@ -65,3 +65,9 @@ gdk_x11_deps = [ xcomposite_dep, xrandr_dep, ] + +libgdk_x11 = static_library('libgdk-x11', + gdk_x11_sources, gdkconfig, gdkenum_h, + include_directories: [confinc, gdkinc], + c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'], + dependencies: [gdk_deps, gdk_x11_deps]) diff --git a/gtk/meson.build b/gtk/meson.build index d410427006..e6caa1e46e 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -795,7 +795,7 @@ gnome.compile_schemas() # install_headers(a11y_headers, subdir: 'gtk-3.0/gtk/a11y/') libgtk = shared_library('gtk', - sources: [typefuncs, gtk_sources, gtkmarshal_h], + sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h], c_args: gtk_cargs, include_directories: [confinc, gdkinc, gtkinc], dependencies: [gtk_deps, libgdk_dep, libgsk_dep],