From 6cc30513acf7970d082610bbdd051dd9cddff57b Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Mon, 23 Jan 2023 00:30:40 -0700 Subject: [PATCH] configure, meson: Eliminate redundant gtk check --- configure | 26 -------------------------- meson.build | 11 ++++++----- meson_options.txt | 4 ++-- ui/meson.build | 4 ++-- ui/thirdparty/meson.build | 2 +- 5 files changed, 11 insertions(+), 36 deletions(-) diff --git a/configure b/configure index 07aa22d8fa..04bcd70a73 100755 --- a/configure +++ b/configure @@ -1562,29 +1562,6 @@ if test "$opengl" != "no" ; then QEMU_CFLAGS="$QEMU_CFLAGS $opengl_cflags" fi # test "$opengl" != "no" -########################################## -# gtk probe - -# Depend on GTK for native file dialog boxes -# FIXME: Add fallback when GTK is unavailable -xemu_gtk="no" -if test "$linux" = "yes" ; then - xemu_gtk="yes" -fi - -# FIXME: Remove duplication with existing GTK detection -if test "$xemu_gtk" != "no"; then - gtkpackage="gtk+-3.0" - gtkversion="3.14.0" - if $pkg_config --exists "$gtkpackage >= $gtkversion"; then - xemu_gtk_cflags=$($pkg_config --cflags $gtkpackage) - xemu_gtk_libs=$($pkg_config --libs $gtkpackage) - xemu_gtk_version=$($pkg_config --modversion $gtkpackage) - elif test "$xemu_gtk" = "yes"; then - feature_not_found "gtk" "Install gtk3-devel" - fi -fi - ########################################## # openssl probe if $pkg_config --exists openssl; then @@ -2458,9 +2435,6 @@ if test "$have_tsan" = "yes" && test "$have_tsan_iface_fiber" = "yes" ; then echo "CONFIG_TSAN=y" >> $config_host_mak fi -echo "XEMU_GTK_CFLAGS=$xemu_gtk_cflags" >> $config_host_mak -echo "XEMU_GTK_LIBS=$xemu_gtk_libs" >> $config_host_mak - echo "OPENSSL_CFLAGS=$openssl_cflags" >> $config_host_mak echo "OPENSSL_LIBS=$openssl_libs" >> $config_host_mak diff --git a/meson.build b/meson.build index 8eff2b2a5e..f385577519 100644 --- a/meson.build +++ b/meson.build @@ -1181,9 +1181,6 @@ toml = declare_dependency(compile_args: ['-DTOML_HEADER_ONLY=0'], genconfig = declare_dependency(include_directories: 'genconfig') -xemu_gtk = declare_dependency(compile_args: config_host['XEMU_GTK_CFLAGS'].split(), - link_args: config_host['XEMU_GTK_LIBS'].split()) - openssl = declare_dependency(compile_args: config_host['OPENSSL_CFLAGS'].split(), link_args: config_host['OPENSSL_LIBS'].split()) @@ -1283,10 +1280,14 @@ gtkx11 = not_found vte = not_found have_gtk_clipboard = get_option('gtk_clipboard').enabled() -if not get_option('gtk').auto() or have_system +# xemu: GTK is required in Linux builds for file selection interfaces. In the +# future, this may be relaxed in the future with alternative options. +require_gtk = targetos == 'linux' + +if require_gtk gtk = dependency('gtk+-3.0', version: '>=3.22.0', method: 'pkg-config', - required: get_option('gtk'), + required: require_gtk, kwargs: static_kwargs) if gtk.found() gtkx11 = dependency('gtk+-x11-3.0', version: '>=3.22.0', diff --git a/meson_options.txt b/meson_options.txt index a16d205b2b..9e16d9fde1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -177,8 +177,8 @@ option('rdma', type : 'feature', value : 'auto', description: 'Enable RDMA-based migration') option('pvrdma', type : 'feature', value : 'auto', description: 'Enable PVRDMA support') -option('gtk', type : 'feature', value : 'auto', - description: 'GTK+ user interface') +# option('gtk', type : 'feature', value : 'auto', +# description: 'GTK+ user interface') option('sdl', type : 'feature', value : 'enabled', description: 'SDL user interface') option('sdl_image', type : 'feature', value : 'auto', diff --git a/ui/meson.build b/ui/meson.build index 37dcc9a2ad..edd2fa71d1 100644 --- a/ui/meson.build +++ b/ui/meson.build @@ -38,10 +38,10 @@ xemu_ss.add(xemu_cocoa) endif if 'CONFIG_LINUX' in config_host -xemu_ss.add(xemu_gtk) +xemu_ss.add(gtk) endif -xemu_ss.add(when: 'CONFIG_LINUX', if_true: [xemu_gtk, files('xemu-os-utils-linux.c')]) +xemu_ss.add(when: 'CONFIG_LINUX', if_true: [gtk, files('xemu-os-utils-linux.c')]) xemu_ss.add(when: 'CONFIG_WIN32', if_true: files('xemu-os-utils-windows.c')) xemu_ss.add(when: 'CONFIG_DARWIN', if_true: files('xemu-os-utils-macos.m')) xemu_ss.add(imgui, implot, stb_image, noc, sdl, opengl, openssl, fa, fpng, json, httplib) diff --git a/ui/thirdparty/meson.build b/ui/thirdparty/meson.build index 803efe465c..a50dd1cb3c 100644 --- a/ui/thirdparty/meson.build +++ b/ui/thirdparty/meson.build @@ -33,7 +33,7 @@ implot = declare_dependency(link_with: libimplot, include_directories: 'implot') noc_ss = ss.source_set() -noc_ss.add(when: 'CONFIG_LINUX', if_true: [xemu_gtk, files('noc_file_dialog/noc_file_dialog_gtk.c')]) +noc_ss.add(when: 'CONFIG_LINUX', if_true: [gtk, files('noc_file_dialog/noc_file_dialog_gtk.c')]) noc_ss.add(when: 'CONFIG_WIN32', if_true: files('noc_file_dialog/noc_file_dialog_win32.cc')) noc_ss.add(when: 'CONFIG_DARWIN', if_true: files('noc_file_dialog/noc_file_dialog_macos.m')) noc_ss = noc_ss.apply(config_all, strict: false)