From e986f8ddbc2e73e433c17346c66ea2c7d8d9aa7a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 15 May 2021 07:49:19 +0300 Subject: [PATCH 49/49] Meson: Add support for building freeciv-mp-gtk4 See osdn #42270 Signed-off-by: Marko Lindqvist --- doc/INSTALL.meson | 4 ++-- meson.build | 21 +++++++++++++++++++++ meson_options.txt | 2 +- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/doc/INSTALL.meson b/doc/INSTALL.meson index b2b84ee353..a78c3444b4 100644 --- a/doc/INSTALL.meson +++ b/doc/INSTALL.meson @@ -103,8 +103,8 @@ clients (array): fcmp (array): List of freeciv modpack installer UIs to build. To disable their build - completely, give an empty array ('-Dfcmp=[]'). Currently gtk3, qt, and cli - are supported. By default builds just gtk3 UI. + completely, give an empty array ('-Dfcmp=[]'). Currently gtk3, qt, gtk4, + and cli are supported. By default builds just gtk3 UI. cacert-path (string): Custom path to CA cert bundle. If this is empty, default path will be used. diff --git a/meson.build b/meson.build index 0f37f910cb..e3b08c0c8f 100644 --- a/meson.build +++ b/meson.build @@ -2106,6 +2106,7 @@ install_data('data/stdsounds/foot3.ogg', endif gtk322_dep = dependency('gtk+-3.0', version : '>= 3.22', required : false) +gtk4_dep = dependency('gtk4', version : '>= 4.0.0', required : false) if get_option('clients').contains('gtk3.22') @@ -2545,6 +2546,26 @@ executable('freeciv-mp-gtk3', endif + +if get_option('fcmp').contains('gtk4') + +if not gtk4_dep.found() + error('gtk-4 required for gtk4 modpack installer, but not found') +endif + +executable('freeciv-mp-gtk4', + 'tools/fcmp/mpgui_gtk4.c', + c_args: [ '-DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_0', + '-DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_4_0'], + include_directories: tool_inc, + dependencies: [gtk4_dep, + c_compiler.find_library('libsqlite3', dirs: cross_lib_path)], + link_with: [common_lib, fcmp_common], + install: true + ) + +endif + if get_option('fcmp').contains('qt') if not qt5_dep.found() diff --git a/meson_options.txt b/meson_options.txt index 52add61500..204e86ce9e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -11,7 +11,7 @@ option('clients', option('fcmp', type: 'array', - choices: ['gtk3','qt','cli'], + choices: ['gtk3','qt','cli','gtk4'], value: ['gtk3'], description: 'Modpack installer UIs to build') -- 2.30.2