From 7820acb65f83dd1ac724ddf58f297c83d2c646bf Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 12 Jun 2022 03:28:36 +0300 Subject: [PATCH 43/43] Meson: Add gtk4-client build support See osdn #44800 Signed-off-by: Marko Lindqvist --- doc/INSTALL.meson | 5 ++-- meson.build | 74 +++++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 2 +- 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson index 79eb71bc39..3a8a5193aa 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -98,8 +98,9 @@ ack_experimental (boolean): clients (array): List of clients to build. To disable client build completely, give an - empty array ('-Dclients=[]'). Currently gtk3.22-, sdl2-client, and qt-client - builds are supported. By default builds only gtk3.22-client + empty array ('-Dclients=[]'). Currently gtk3.22-, sdl2-, qt-, + and gtk4-client builds are supported. + By default builds just gtk3.22-client. fcmp (array): List of freeciv modpack installer UIs to build. To disable their build diff --git a/meson.build b/meson.build index 06ad423591..4e2b91e69a 100644 --- a/meson.build +++ b/meson.build @@ -2511,6 +2511,80 @@ install_data('data/themes/gtk3.22/Freeciv/gtk-3.0/gtk.css', endif +if get_option('clients').contains('gtk4') + +if not gtk4_dep.found() + error('gtk-4.0 >= 4.0 required for gtk4-client, but not found') +endif + +executable('freeciv-gtk4', + 'client/gui-gtk-4.0/action_dialog.c', + 'client/gui-gtk-4.0/canvas.c', + 'client/gui-gtk-4.0/chatline.c', + 'client/gui-gtk-4.0/choice_dialog.c', + 'client/gui-gtk-4.0/citizensinfo.c', + 'client/gui-gtk-4.0/citydlg.c', + 'client/gui-gtk-4.0/cityrep.c', + 'client/gui-gtk-4.0/cma_fe.c', + 'client/gui-gtk-4.0/colors.c', + 'client/gui-gtk-4.0/connectdlg.c', + 'client/gui-gtk-4.0/dialogs.c', + 'client/gui-gtk-4.0/diplodlg.c', + 'client/gui-gtk-4.0/editgui.c', + 'client/gui-gtk-4.0/editprop.c', + 'client/gui-gtk-4.0/finddlg.c', + 'client/gui-gtk-4.0/gamedlgs.c', + 'client/gui-gtk-4.0/gotodlg.c', + 'client/gui-gtk-4.0/graphics.c', + 'client/gui-gtk-4.0/gui_main.c', + 'client/gui-gtk-4.0/gui_stuff.c', + 'client/gui-gtk-4.0/happiness.c', + 'client/gui-gtk-4.0/helpdlg.c', + 'client/gui-gtk-4.0/infradlg.c', + 'client/gui-gtk-4.0/inputdlg.c', + 'client/gui-gtk-4.0/inteldlg.c', + 'client/gui-gtk-4.0/luaconsole.c', + 'client/gui-gtk-4.0/mapctrl.c', + 'client/gui-gtk-4.0/mapview.c', + 'client/gui-gtk-4.0/menu.c', + 'client/gui-gtk-4.0/messagedlg.c', + 'client/gui-gtk-4.0/messagewin.c', + 'client/gui-gtk-4.0/optiondlg.c', + 'client/gui-gtk-4.0/pages.c', + 'client/gui-gtk-4.0/plrdlg.c', + 'client/gui-gtk-4.0/rallypointdlg.c', + 'client/gui-gtk-4.0/repodlgs.c', + 'client/gui-gtk-4.0/soundset_dlg.c', + 'client/gui-gtk-4.0/spaceshipdlg.c', + 'client/gui-gtk-4.0/sprite.c', + 'client/gui-gtk-4.0/theme_dlg.c', + 'client/gui-gtk-4.0/themes.c', + 'client/gui-gtk-4.0/tileset_dlg.c', + 'client/gui-gtk-4.0/transportdlg.c', + 'client/gui-gtk-4.0/unitselect.c', + 'client/gui-gtk-4.0/unitselextradlg.c', + 'client/gui-gtk-4.0/unitselunitdlg.c', + 'client/gui-gtk-4.0/voteinfo_bar.c', + 'client/gui-gtk-4.0/wldlg.c', + clienticon, + c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_0', + '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_0', + '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_66', + '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66'], + include_directories: client_inc, + dependencies: [gtk4_dep, net_dep, gettext_dep], + link_with: client_common, + install: true + ) + +install_data('data/themes/gtk4/Freeciv/gtk-4.0/gtk.css', + 'data/themes/gtk4/Freeciv/gtk-4.0/menubar.css', + 'data/themes/gtk4/Freeciv/gtk-4.0/bg.png', + install_dir : join_paths(get_option('datadir'), + 'freeciv/themes/gtk4/Freeciv/gtk-4.0')) + +endif + if get_option('qtver') == 'qt6' qt_mod = import('qt6') diff --git a/meson_options.txt b/meson_options.txt index 8d016e92f6..7679d7d919 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -5,7 +5,7 @@ option('ack_experimental', option('clients', type: 'array', - choices: ['gtk3.22','sdl2', 'qt'], + choices: ['gtk3.22','sdl2', 'qt', 'gtk4'], value: ['gtk3.22'], description: 'Clients to build') -- 2.35.1