Merge branch 'wip/lantw/improve-freebsd-build-and-fix-warnings' into 'master'

Improve meson.build for FreeBSD and reduce the number of warnings during compilation

See merge request GNOME/gtk!123
This commit is contained in:
Matthias Clasen 2018-04-23 02:40:00 +00:00
commit 9178f74067
8 changed files with 39 additions and 29 deletions

View File

@ -33,14 +33,14 @@ hex_spin_output (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
gchar *buf;
gint val;
gdouble val;
adjustment = gtk_spin_button_get_adjustment (spin_button);
val = (gint) gtk_adjustment_get_value (adjustment);
val = gtk_adjustment_get_value (adjustment);
if (fabs (val) < 1e-5)
buf = g_strdup ("0x00");
else
buf = g_strdup_printf ("0x%.2X", val);
buf = g_strdup_printf ("0x%.2X", (gint) val);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);
g_free (buf);

View File

@ -18,7 +18,7 @@
*/
#ifndef __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__
#define __GTK_CSS_FONT_FEATURES_PRIVATE_H__
#define __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -18,7 +18,7 @@
*/
#ifndef __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__
#define __GTK_CSS_FONT_VARIATIONS_PRIVATE_H__
#define __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -418,7 +418,6 @@ get_im (GdkSurface *client_surface,
}
else
{
tmp_info = tmp_info;
break;
}
}

View File

@ -102,20 +102,25 @@ os_darwin = false
# to ensure they are enabled
if host_machine.system() == 'darwin'
os_darwin = true
win32_enabled = false
elif host_machine.system() == 'windows'
os_win32 = true
win32_enabled = true
x11_enabled = false
wayland_enabled = false
quartz_enabled = false
elif host_machine.system() == 'linux'
os_linux = true
win32_enabled = false
endif
os_unix = not os_win32
if os_darwin
wayland_enabled = false
else
quartz_enabled = false
endif
os_unix = not os_win32
if os_win32
wayland_enabled = false
x11_enabled = false
else
win32_enabled = false
endif
gtk_prefix = get_option('prefix')
gtk_includedir = join_paths(gtk_prefix, get_option('includedir'))
@ -265,7 +270,7 @@ common_cflags = cc.get_supported_arguments(test_cflags)
# Symbol visibility
if get_option('default_library') != 'static'
if host_machine.system() == 'windows'
if os_win32
cdata.set('DLL_EXPORT', true)
cdata.set('_GDK_EXTERN', '__declspec(dllexport) extern')
if cc.get_id() != 'msvc'
@ -279,12 +284,16 @@ endif
common_ldflags = []
if host_machine.system() == 'linux' and cc.get_id() == 'gcc'
common_ldflags += [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
if os_unix and not os_darwin
foreach ldflag: [ '-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now', ]
if cc.links('int main () { return 0; }', name: ldflag, args: ldflag)
common_ldflags += [ ldflag ]
endif
endforeach
endif
# Maintain compatibility with autotools
if host_machine.system() == 'darwin'
if os_darwin
common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ]
endif
@ -299,10 +308,11 @@ glib_dep = dependency('glib-2.0', version: glib_req,
fallback : ['glib', 'libglib_dep'])
gobject_dep = dependency('gobject-2.0', version: glib_req,
fallback : ['glib', 'libgobject_dep'])
if host_machine.system() == 'windows'
if os_win32
giowin32_dep = dependency('gio-windows-2.0', version: glib_req, required: win32_enabled,
fallback : ['glib', 'libgio_dep'])
else
endif
if os_unix
giounix_dep = dependency('gio-unix-2.0', version: glib_req, required: false,
fallback : ['glib', 'libgio_dep'])
endif
@ -370,9 +380,10 @@ iso_codes_dep = dependency('iso-codes', required: false)
fontconfig_dep = [] # only used in x11 backend
atkbridge_dep = [] # only used in x11 backend
if host_machine.system() == 'windows'
if os_win32
platform_gio_dep = giowin32_dep
else
endif
if os_unix
platform_gio_dep = giounix_dep
endif
@ -582,7 +593,7 @@ if cc.has_function('bind_textdomain_codeset', dependencies: libintl_dep)
cdata.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1)
endif
if host_machine.system() != 'windows'
if os_unix
cdata.set('HAVE_GIO_UNIX', giounix_dep.found())
endif
@ -723,7 +734,7 @@ foreach pkg: pkgs
install_dir: pkg_install_dir)
endforeach
if host_machine.system() != 'windows'
if os_unix
configure_file(input: 'gtk+-unix-print-4.0.pc.in',
output: 'gtk+-unix-print-4.0.pc',
configuration: pkgconf,

View File

@ -1,8 +1,8 @@
# GDK backends
option('x11-backend', type: 'boolean', value: true,
description : 'Enable the X11 gdk backend (only when building on Linux or macOS)')
description : 'Enable the X11 gdk backend (only when building on Unix)')
option('wayland-backend', type: 'boolean', value: true,
description : 'Enable the wayland gdk backend (only when building on Linux)')
description : 'Enable the wayland gdk backend (only when building on Unix except for macOS)')
option('broadway-backend', type: 'boolean', value: false,
description : 'Enable the broadway (HTML5) gdk backend')
option('win32-backend', type: 'boolean', value: true,

View File

@ -133,7 +133,7 @@ gtk_tests = [
['testtexture'],
]
if os_linux
if os_unix
gtk_tests += [['testfontchooserdialog']]
endif

View File

@ -3240,14 +3240,14 @@ spin_button_hex_output_func (GtkSpinButton *spin_button)
{
GtkAdjustment *adjustment;
static gchar buf[7];
gint val;
gdouble val;
adjustment = gtk_spin_button_get_adjustment (spin_button);
val = (gint) gtk_adjustment_get_value (adjustment);
val = gtk_adjustment_get_value (adjustment);
if (fabs (val) < 1e-5)
sprintf (buf, "0x00");
else
sprintf (buf, "0x%.2X", val);
sprintf (buf, "0x%.2X", (gint) val);
if (strcmp (buf, gtk_spin_button_get_text (spin_button)))
gtk_spin_button_set_text (spin_button, buf);