From c1cdc29233a95bb943d6fa6cd34e9e7675761ce7 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 7 Apr 2023 07:55:48 +0300 Subject: [PATCH 20/20] Meson: Add support for gtk4x-client See osdn #47611 Signed-off-by: Marko Lindqvist --- doc/INSTALL.meson | 2 +- doc/README.packaging | 2 ++ meson.build | 69 ++++++++++++++++++++++++++++++++++++++++++++ meson_options.txt | 2 +- 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson index b300cc46ea..9fbe1e2b14 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -100,7 +100,7 @@ Freeciv specific configure options: clients (array): List of clients to build. To disable client build completely, give an empty array ('-Dclients=[]'). Currently gtk3.22-, sdl2-, qt-, - gtk4-, and stub-client builds are supported. + gtk4-, gtk4x-, and stub-client builds are supported. By default builds just gtk3.22-client. fcmp (array): diff --git a/doc/README.packaging b/doc/README.packaging index e67ec82d1f..74e8987171 100644 --- a/doc/README.packaging +++ b/doc/README.packaging @@ -22,6 +22,8 @@ Updating from 3.2 to 3.3 You have to use separate build dir(s) * New 'qt6x' mode for building Qt based components linked against relatively new Qt6 versions +* Build with meson supports building gtk4x-client that is linked + against relatively new gtk4 versions ---------------------------------------------------------------------- Compatibility of modified versions diff --git a/meson.build b/meson.build index f8c799b0cb..a70df87035 100644 --- a/meson.build +++ b/meson.build @@ -2833,6 +2833,7 @@ endforeach gtk322_dep = dependency('gtk+-3.0', version : '>= 3.22', required : false) gtk4_dep = dependency('gtk4', version : '>= 4.0.0', required : false) +gtk5_dep = dependency('gtk4', version : '>= 4.8.0', required : false) if get_option('clients').contains('gtk3.22') @@ -3013,6 +3014,74 @@ custom_target('mi_gtk4', endif +if get_option('clients').contains('gtk4x') + +if not gtk5_dep.found() + error('gtk-4.0 >= 4.8 required for gtk4x-client, but not found') +endif + +executable('freeciv-gtk4x', + '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_8', + '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_8', + '-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_66', + '-DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_66'], + include_directories: client_inc, + dependencies: [gtk5_dep, net_dep, gettext_dep], + link_with: client_common, + install: true + ) + +endif + if qtver == 'qt6' or qtver == 'qt6x' qt_mod = import('qt6') diff --git a/meson_options.txt b/meson_options.txt index ba30f446ae..ca8c93967c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,6 @@ option('clients', type: 'array', - choices: ['gtk3.22','sdl2', 'qt', 'gtk4', 'stub'], + choices: ['gtk3.22','sdl2', 'qt', 'gtk4', 'stub', 'gtk4x'], value: ['gtk3.22'], description: 'Clients to build') -- 2.39.2