Ensure gtkutil.h derives HAVE_GTK3 from GTK_MAJOR_VERSION when missing so GTK3/GTK4 builds select the correct typedefs and declarations in Windows builds that include gtkutil.h directly.

Link libX11 on non-Windows builds regardless of GTK2/GTK3 to satisfy the X11 symbols used in gtkutil.c, fixing the GTK2 linker failure.
This commit is contained in:
2026-02-05 08:14:59 -07:00
parent 0dd25cb631
commit 9e9a0be80d
2 changed files with 14 additions and 4 deletions

View File

@@ -26,6 +26,14 @@
typedef void (*filereqcallback) (void *, char *file);
#ifndef HAVE_GTK3
#if GTK_MAJOR_VERSION >= 3
#define HAVE_GTK3 1
#else
#define HAVE_GTK3 0
#endif
#endif
#if HAVE_GTK3
typedef enum
{

View File

@@ -57,10 +57,12 @@ endif
zoitechat_gtk_deps += gtk_dep
if get_option('gtk3') and host_machine.system() != 'windows'
gdk_x11_dep = dependency('gdk-x11-3.0', required: false)
if gdk_x11_dep.found()
zoitechat_gtk_deps += gdk_x11_dep
if host_machine.system() != 'windows'
if get_option('gtk3')
gdk_x11_dep = dependency('gdk-x11-3.0', required: false)
if gdk_x11_dep.found()
zoitechat_gtk_deps += gdk_x11_dep
endif
endif
x11_dep = dependency('x11', required: false)