Merge branch 'wip/otte/build' into 'master'

Streamline build configuration

See merge request GNOME/gtk!3391
This commit is contained in:
Matthias Clasen 2021-07-20 18:25:59 +00:00
commit 94eb3d7ac0
13 changed files with 53 additions and 134 deletions

View File

@ -172,6 +172,7 @@ macos:
- meson -Dx11-backend=false
-Dbroadway-backend=true
-Dmacos-backend=true
-Dmedia-gstreamer=disabled
-Dintrospection=disabled
-Dcpp_std=c++11
-Dpixman:tests=disabled

View File

@ -15,7 +15,7 @@ meson \
-Dx11-backend=true \
-Dwayland-backend=true \
-Dbroadway-backend=true \
-Dvulkan=yes \
-Dvulkan=enabled \
-Dprofiler=true \
--werror \
${EXTRA_MESON_FLAGS:-} \

View File

@ -6,7 +6,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
:: FIXME: make warnings fatal
pip3 install --upgrade --user meson==0.56.2 || goto :error
meson _build || goto :error
meson -Dmedia-gstreamer=disabled _build || goto :error
ninja -C _build || goto :error
goto :EOF

View File

@ -124,9 +124,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#mesondefine HAVE_UNISTD_H
/* Have the XCOMPOSITE X extension */
#mesondefine HAVE_XCOMPOSITE
/* Have the Xcursor library */
#mesondefine HAVE_XCURSOR

View File

@ -69,10 +69,6 @@
#include <X11/extensions/shape.h>
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
#endif
#ifdef HAVE_RANDR
#include <X11/extensions/Xrandr.h>
#endif
@ -1454,24 +1450,6 @@ gdk_x11_display_open (const char *display_name)
#endif
display_x11->have_xfixes = FALSE;
#ifdef HAVE_XCOMPOSITE
if (XCompositeQueryExtension (display_x11->xdisplay,
&ignore, &ignore))
{
int major, minor;
XCompositeQueryVersion (display_x11->xdisplay, &major, &minor);
/* Prior to Composite version 0.4, composited windows clipped their
* parents, so you had to use IncludeInferiors to draw to the parent
* This isn't useful for our purposes, so require 0.4
*/
display_x11->have_xcomposite = major > 0 || (major == 0 && minor >= 4);
}
else
#endif
display_x11->have_xcomposite = FALSE;
display_x11->have_shapes = FALSE;
display_x11->have_input_shapes = FALSE;

View File

@ -71,8 +71,6 @@ struct _GdkX11Display
gboolean have_xfixes;
int xfixes_event_base;
gboolean have_xcomposite;
gboolean have_randr12;
gboolean have_randr13;
gboolean have_randr15;

View File

@ -47,9 +47,6 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/shape.h>
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
#endif
#include <string.h>
@ -518,9 +515,6 @@ gdk_surface_cache_new (GdkDisplay *display)
Window xroot_window = GDK_DISPLAY_XROOTWIN (display);
GdkChildInfoX11 *children;
guint nchildren, i;
#ifdef HAVE_XCOMPOSITE
Window cow;
#endif
GdkSurfaceCache *result = g_new (GdkSurfaceCache, 1);
@ -571,27 +565,6 @@ gdk_surface_cache_new (GdkDisplay *display)
g_free (children);
#ifdef HAVE_XCOMPOSITE
/*
* Add the composite overlay window to the cache, as this can be a reasonable
* Xdnd proxy as well.
* This is only done when the screen is composited in order to avoid mapping
* the COW. We assume that the CM is using the COW (which is true for pretty
* much any CM currently in use).
*/
if (gdk_display_is_composited (display))
{
gdk_x11_display_error_trap_push (display);
cow = XCompositeGetOverlayWindow (xdisplay, xroot_window);
gdk_surface_cache_add (result, cow, 0, 0,
WidthOfScreen (GDK_X11_SCREEN (screen)->xscreen),
HeightOfScreen (GDK_X11_SCREEN (screen)->xscreen),
TRUE);
XCompositeReleaseOverlayWindow (xdisplay, xroot_window);
gdk_x11_display_error_trap_pop_ignored (display);
}
#endif
return result;
}

View File

@ -45,9 +45,6 @@
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/shape.h>
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
#endif
#include <string.h>

View File

@ -65,14 +65,6 @@
#include <X11/XKBlib.h>
#endif
#ifdef HAVE_XCOMPOSITE
#include <X11/extensions/Xcomposite.h>
#endif
#ifdef HAVE_XFIXES
#include <X11/extensions/Xfixes.h>
#endif
const int _gdk_x11_event_mask_table[21] =
{
ExposureMask,

View File

@ -69,7 +69,6 @@ gdk_x11_deps = [
xcursor_dep,
xdamage_dep,
xfixes_dep,
xcomposite_dep,
xrandr_dep,
xinerama_dep,
]

View File

@ -839,23 +839,25 @@ gtk_gresources_xml = configure_file(output: 'gtk.gresources.xml',
],
)
# Build the theme files
sassc = find_program('sassc', required: false)
if not sassc.found() and not get_option('sassc').disabled()
subproject('sassc')
sassc = find_program('sassc', required: get_option('sassc').enabled())
endif
theme_deps = []
# For git checkouts, but not for tarballs...
if not fs.exists('theme/Adwaita/Adwaita.css')
# ... build the theme files
sassc = find_program('sassc', required: false)
if not sassc.found()
subproject('sassc')
sassc = find_program('sassc', required: true)
endif
if sassc.found()
sassc_opts = [ '-a', '-M', '-t', 'compact' ]
if sassc.found()
sassc_opts = [ '-a', '-M', '-t', 'compact' ]
subdir('theme/Default')
subdir('theme/Default')
theme_deps = [
default_theme_deps,
]
else
theme_deps = []
theme_deps += [
default_theme_deps,
]
endif
endif
gtkresources = gnome.compile_resources('gtkresources',

View File

@ -24,6 +24,7 @@ cloudproviders_req = '>= 0.3.1'
xkbcommon_req = '>= 0.2.0'
sysprof_req = '>= 3.38.0'
fs = import('fs')
gnome = import('gnome')
pkg_config = import('pkgconfig')
@ -496,46 +497,34 @@ if x11_enabled
xrender_dep = dependency('xrender')
xi_dep = dependency('xi')
xext_dep = dependency('xext')
xcursor_dep = dependency('xcursor', required: false)
xdamage_dep = dependency('xdamage', required: false)
xfixes_dep = dependency('xfixes', required: false)
xcomposite_dep = dependency('xcomposite', required: false)
xcursor_dep = dependency('xcursor')
xdamage_dep = dependency('xdamage')
xfixes_dep = dependency('xfixes')
fontconfig_dep = dependency('fontconfig')
x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr']
x11_pkgs = ['fontconfig', 'x11', 'xext', 'xi', 'xrandr', 'xcursor', 'xdamage', 'xfixes', 'xinerama']
if xcursor_dep.found()
x11_pkgs += ['xcursor']
endif
if xdamage_dep.found()
x11_pkgs += ['xdamage']
endif
if xfixes_dep.found()
x11_pkgs += ['xfixes']
endif
if xcomposite_dep.found()
x11_pkgs += ['xcomposite']
endif
cdata.set('HAVE_XCURSOR', 1)
cdata.set('HAVE_XDAMAGE', 1)
cdata.set('HAVE_XFIXES', 1)
cdata.set('HAVE_XCURSOR', xcursor_dep.found())
cdata.set('HAVE_XDAMAGE', xdamage_dep.found())
cdata.set('HAVE_XCOMPOSITE', xcomposite_dep.found())
cdata.set('HAVE_XFIXES', xfixes_dep.found())
if cc.has_function('XkbQueryExtension', dependencies: x11_dep,
prefix : '#include <X11/XKBlib.h>')
cdata.set('HAVE_XKB', 1)
if not cc.has_function('XkbQueryExtension', dependencies: x11_dep,
prefix : '#include <X11/XKBlib.h>')
error('X11 backend enabled, but Xkb not found.')
endif
cdata.set('HAVE_XKB', 1)
if cc.has_function('XSyncQueryExtension', dependencies: xext_dep,
prefix: '''#include <X11/Xlib.h>
#include <X11/extensions/sync.h>''')
cdata.set('HAVE_XSYNC', 1)
if not cc.has_function('XSyncQueryExtension', dependencies: xext_dep,
prefix: '''#include <X11/Xlib.h>
#include <X11/extensions/sync.h>''')
error('X11 backend enabled, but Xsync not found.')
endif
cdata.set('HAVE_XSYNC', 1)
if cc.has_function('XGetEventData', dependencies: x11_dep)
cdata.set('HAVE_XGENERICEVENTS', 1)
if not cc.has_function('XGetEventData', dependencies: x11_dep)
error('X11 backend enabled, but no generic event support.')
endif
cdata.set('HAVE_XGENERICEVENTS', 1)
if not xi_dep.found() or not cc.has_header('X11/extensions/XInput2.h', dependencies: xi_dep)
error('X11 backend enabled, but XInput2 not found.')
@ -548,15 +537,16 @@ if x11_enabled
has_scroll_class_info = cc.has_member('XIScrollClassInfo', 'number', dependencies: xi_dep,
prefix: '''#include <X11/Xlib.h>
#include <X11/extensions/XInput2.h>''')
if has_allow_touch_events and has_scroll_class_info
cdata.set('XINPUT_2_2', 1)
if not has_allow_touch_events or not has_scroll_class_info
error('X11 backend enabled, but XInput2.2 not found.')
endif
cdata.set('XINPUT_2_2', 1)
xinerama_dep = dependency('xinerama', required: get_option('xinerama'))
if xinerama_dep.found() and cc.has_header_symbol('X11/extensions/Xinerama.h', 'XineramaQueryExtension', dependencies: xinerama_dep)
cdata.set('HAVE_XFREE_XINERAMA', 1)
x11_pkgs += ['xinerama']
xinerama_dep = dependency('xinerama')
if not cc.has_header_symbol('X11/extensions/Xinerama.h', 'XineramaQueryExtension', dependencies: xinerama_dep)
error('X11 backend enabled, but Xinerama extension does not work.')
endif
cdata.set('HAVE_XFREE_XINERAMA', 1)
cdata.set('HAVE_RANDR', xrandr_dep.found())
cdata.set('HAVE_RANDR15', xrandr15_dep.found())

View File

@ -26,15 +26,17 @@ option('macos-backend',
description : 'Enable the macOS gdk backend (only when building on macOS)')
# Media backends
# For distros: GTK guarantees support for WebM video (VP8 and VP9), so a supported build
# should provide that.
option('media-ffmpeg',
type: 'feature',
value: 'auto',
description : 'Build the ffmpeg media backend')
value: 'disabled',
description : 'Build the experimental ffmpeg media backend')
option('media-gstreamer',
type: 'feature',
value: 'auto',
value: 'enabled',
description : 'Build the gstreamer media backend')
# Print backends
@ -48,13 +50,8 @@ option('print-cups',
option('vulkan',
type: 'feature',
value: 'auto',
description : 'Enable support for the Vulkan graphics API')
option('xinerama',
type: 'feature',
value: 'auto',
description : 'Enable support for the X11 Xinerama extension')
value: 'disabled',
description : 'Enable support for the experimental Vulkan graphics API')
option('cloudproviders',
type: 'feature',
@ -76,11 +73,6 @@ option('colord',
value: 'disabled',
description : 'Build colord support for the CUPS printing backend')
option('sassc',
type: 'feature',
value: 'auto',
description: 'Rebuild themes using sassc')
option('f16c',
type: 'feature',
value: 'enabled',