Commit Graph

383 Commits

Author SHA1 Message Date
Timm Bäder
7194196100 build: Make GCC ignore fallthrough comments
From the GCC manpage:

> Wimplicit-fallthrough=5 doesn't recognize any comments as
> fallthrough comments, only attributes disable
> the warning.

So, check for the =5 version after checking for the simple version. This
way we get -Wfallhrough with clang and -Wfallthrough -Wfallthrough=5
with GCC, which works.
2022-01-27 16:05:33 +01:00
José Expósito
0f351508bc build: Bump wayland-protocols to v1.23
Part-of: <!3454>
2022-01-26 22:47:51 +01:00
Jonas Ådahl
66ebc660b4 wayland/surface: Use wl_surface_offset() instead of x,y of attach()
This makes the hotspot of DND surfaces work when using the Vulkan and
OpenGL renderers.

This bumps the CI image used to the newly built image. This is needed to
install a new enough libwayland-client.so needed for wl_surface.offset.

This is done by adding wayland as a meson subproject, building it
on-demand if the version in the system is not new enough. As
libwayland-client.so is pulled in implicitly when linking to gtk4, the
compile step needs LD_LIBRARY_PATH set to make ld find the right library
to link to.
2022-01-14 09:27:07 +01:00
Chun-wei Fan
629dcd3dcf meson.build: Don't apply iso-codes cflag on Windows
They are no longer applicable for Windows builds.
2022-01-12 17:29:30 +08:00
Bilal Elmoussaoui
ed3d9aaaed meson: only update-icon-cache when the demos are built
Without building the demos, nothing gets installed into $prefix/share/icons/hicolor. Which makes running 
`gtk4-update-icon-cache` on the machine causes an error. This is easily reproducible on a Windows machine with MSVC where 
there is nothing pre-installed on hicolor icon theme and that makes building gtk without the demos fails with "No such file or directory".
2022-01-09 07:27:59 +00:00
Luca Bacci
1c633cbea2
Add hid.lib to pkg-config file listing 2022-01-02 18:45:17 +01:00
Matthias Clasen
70cb61fb71 4.6.0 2021-12-30 10:31:52 -05:00
Emmanuele Bassi
a70988ecd5 build: Remove deprecated get_pkgconfig_variable()
Replace it with `get_variable(pkgconfig:...)`.
2021-12-24 15:55:26 +00:00
Matthias Clasen
28f0e2eb2a 4.5.1 2021-12-16 21:43:20 -05:00
Matthias Clasen
97c09c827b Fix the targets variable in pc files
This is meant as a space-separated list of
string, so escaping the spaces is uncalled
for.

Fixes: #4486
2021-12-10 11:36:07 -05:00
Matthias Clasen
0370672886 Require meson 0.59
This is needed to fix a regression in our pc file
generation.
2021-12-10 11:34:23 -05:00
Matthias Clasen
4058b80d56 Bump pango req
Require pango 1.50.
2021-12-02 21:24:24 -05:00
Benjamin Otte
c003260d63 build: Actually use the extra warnings
I forgot to remove the '-Werror=' part from all the extra warnings, so
the warning/error flags we generated were '-Werror=-Werror=warning-flag'
or 'W-Werror=warning-flag' - but because our compiler flag checking
infrastructure works so nicely, it just ignored these obviously wrong
flags.

Fixes commit 362e91c40b
2021-11-15 14:59:18 +01:00
Benjamin Otte
362e91c40b build: Don't use any -Werror in release builds
Do kep them for debug and debugoptimized builds though.

Keeping -Werror flags in release builds causes issues with forward
compatibility, when new compiler releases or different toolchains
suddenly cause those warnings to be emitted during compilation.

While we certainly want those issues to be investigated and fixed, they
should not prevent anyone from building GTK until they are.

Resolves #4388
2021-11-10 20:04:07 +01:00
Matthias Clasen
cca8ae04b6 Bump the pango requirement to 1.49.3
Required for new PangoVariant enumeration values.
2021-11-08 14:17:42 -05:00
Carlos Garnacho
206d7635f7 Merge branch 'x11-xi2.4-gestures' into 'master'
Touchpad gestures for X11 (XInput 2.4, X Server 21.1)

See merge request GNOME/gtk!3610
2021-10-28 16:44:52 +00:00
Benjamin Otte
3c9c7a0e72 build: Make sure ifuncs exist when using fp16
Fixes msys compiles on Windows (and everywhere else hopefully).

Fixes #4285
2021-10-22 17:50:42 +02:00
Benjamin Otte
ae8de7168a build: Add a HAVE_EGL define to config.h 2021-10-06 03:43:47 +02:00
Timm Bäder
b7ad3bcf96 build: Print toolchain in summary
Would be nice to print CFLAGS and LDFLAGS as well, but that's not as
easy.
2021-10-02 09:08:14 +02:00
Chun-wei Fan
dbd0ce30d9 meson: Improve search for libpng
On Visual Studio-style builds, it is likely that we do not have pkg-config
files for libpng, so improve the search for libpng by using CMake's built-in
mechanisms for looking for libpng.  This, however, means that we need to use
'png' rather than 'libpng' for the package name to search for.
2021-09-30 16:21:45 +08:00
Povilas Kanapickas
68bd94fa25 gdk/x11: Implement XI2.4 touchpad gesture support 2021-09-27 23:19:33 +03:00
Matthias Clasen
729ba8111a Add code to load jpegs
This lets us avoid gdk-pixbuf for loading
textures from the common image formats.

As a consequence, we are now linking against libjpeg.
2021-09-17 00:25:22 +02:00
Matthias Clasen
a03594df52 Add code to load and save tiff files
Add support for the tiff format, which is flexible
enough to handle all our memory texture formats
without loss.

As a consequence, we are now linking against libtiff.
2021-09-17 00:25:22 +02:00
Matthias Clasen
f51f7f85eb Add code to load and save pngs
Using libpng instead of the lowest-common-denominator
gdk-pixbuf loader. This will allow us to load >8bit data,
and apply gamma and color correction in the future.
For now, this still just provides RGBA8 data.

As a consequence, we are now linking against libpng.
2021-09-17 00:25:22 +02:00
muradm
c9aec9b5a2 Do not require wayland-protocols as dependency in the .pc file
Basically, I was building some packages on Guix. I figured out that
wayland-protocols was listed among propagated-inputs for gtk+ package
(gtk-3-24). propagated-inputs holds a list of runtime dependencies,
that should be available to any other package that depends on gtk+.
While discussing we clarified that wayland-protocols is not runtime
dependency. So I moved it to native-inputs of gtk+ package, which
means that, this dependency will be available only to gtk+ package and
only at build time. Once moved, building of other applications that
depening on gtk+ started to fail.

Investigation showed that, all .pc (pkg-config) files prepared by gtk+
package, was including:

Requires.private: ... wayland-protocols ...

Since it becomes requirement, other applications was failing with
missing dependency wayland-protocols of dependency gtk+, for instance:

-- Checking for module 'gtk+-3.0'
--   Package 'wayland-protocols', required by 'gdk-3.0', not found

While actually wayland-protocols is not even a build time dependency
of application that depends on gtk+. Advertisement of such
requirement, is a bit misleading, because one does not need it at
runtime, especially applications based on gtk.
2021-09-16 20:31:30 +03:00
Matthias Clasen
76f481eb7b Stop using config.h.meson
It isn't necessary and makes us miss defines when
we forget to update it.
2021-09-10 21:08:07 -04:00
Matthias Clasen
bd4d24f8ed Bump pango req to 1.49.1
We are using pango api that was introduced in 1.49.1
without ifdefs, so we should require it.
2021-09-05 10:58:50 -04:00
Matthias Clasen
bea4aa31ea Bump Pango dep
Require Pango 1.49, so we can support new attributes
without too much ifdeffery.
2021-08-22 15:23:42 -04:00
Matthias Clasen
94e68b0e36 Bump version to 4.5
4.4 has been branched off.
2021-08-22 13:06:29 -04:00
Matthias Clasen
f1f197e3b9 4.4.0 2021-08-20 15:10:25 -04:00
Simon Ser
ad0c1d4dbe gdk/wayland: add support for wl_seat version 7
Version 7 requires wl_keyboard keymaps to be mapped with
MAP_PRIVATE, so that the compositor can share the same keymap
file between multiple clients.
2021-08-11 16:37:03 +02:00
Matthias Clasen
0bf46b4845 Bump the harfbuzz dep
We need 2.1.0, which has the hb_ot_color apis that we
are going to use in the next commit.
2021-07-31 16:34:38 -04:00
Matthias Clasen
39005461c5 4.3.2 2021-07-24 22:04:49 -04:00
Benjamin Otte
f2b41e708d build: Build demos before tools
That's a sneaky trick so my edit/compile/test cycle goes faster:
I usually use demos for testing so the tools don't have to be linked for
me to start testing.
2021-07-22 16:06:05 +02:00
Benjamin Otte
0ae2acfb1a x11: Remove XComposite
It's only used during DND to allow use of the root window's cow window
as a DND target, because apparently gnome-shell used to think that was a
great idea to DND to the overview.

Somebody complain to gnome-shell devs about it not being a good idea if
they want it fixed.
Potentially using Wayland is a better idea though.

This reverts 85ae875dcb

Related: https://bugzilla.gnome.org/show_bug.cgi?id=601731
2021-07-20 14:00:25 -04:00
Benjamin Otte
e544c891ca build: Make all X11 extensions mandatory
It's not 2011 anymore, and we shouldn't randomly build one of 10.000
different combinations of X11 backends (I counted the possibilities) but
exactly the one we expect people to use.
2021-07-20 14:00:25 -04:00
Benjamin Otte
af0c95c11a build: Remove sassc option
Instead, ensure that sassc is made madatory on git builds (because
it is, we don't ship CSS files anymore) and not even looked for in
release builds (because do ship CSS files there).
2021-07-20 14:00:25 -04:00
Maximiliano Sandoval R
94c2072be8
meson: Use a valid SPDX identifier
See https://mesonbuild.com/Reference-manual.html#license
2021-07-16 11:14:46 +02:00
Marco Trevisan (Treviño)
d5f2b69d0c build: Get typelib dir dynamically using gobject-introspection dependency
We hardcoded the typelib directory for only an arch (and a distro),
while we can just get it from gobject-introspection pkg config if tests
are enabled.
2021-07-08 04:59:10 +02:00
Xavier Claessens
0fd790eb8d Meson: Only g-ir-scanner warnings fatal when buit with -Dwerror=true
Also fix deprecation warning that requires using fatal_warnings kwarg
from Meson 0.55.0.

Fixes: #4072.
2021-06-25 11:38:11 -04:00
Matthias Clasen
143770f16d 4.3.1 2021-06-09 18:23:47 -04:00
Dan Cîrnaț
13b94dab10 Conditional check for gdesktopappinfo header
GDesktopAppInfo is not available on macOS and needs to be disabled
2021-05-06 10:38:41 +02:00
Matthias Clasen
6a24e0c7c3 Add an introspection api test
Every beginning is small... just check one constant for now.
2021-05-05 19:18:32 -04:00
Matthias Clasen
c8eeb46aa5 Merge branch 'update-ci-to-f34' into 'master'
WIP ci: Update the image to Fedora 34

See merge request GNOME/gtk!3516
2021-05-05 23:17:07 +00:00
Matthias Clasen
930ff499ee Confine -mf16c to a single source file
We can't use this flag for any code that may get run
outside the __builtin_cpu_supports() check, and meson
doesn't allow per-file cflags. So we have to split this
code off into its own static library.
2021-05-05 18:58:23 -04:00
Xavier Claessens
f4dc24c3da Meson: gdk-pixbuf jpeg/png options changed to feature 2021-05-05 16:40:57 -04:00
Carlos Garnacho
be4216e051 gdk/wayland: Support the xdg-activation wayland protocol
This protocol implements the IPC necessary to focus application
windows across launcher/launchee. Add support for it.
2021-05-03 17:20:50 +02:00
Matthias Clasen
ead06fdb35 Bump version to 4.3.0
We are going to add new API.

Fix up affected tests.
2021-05-02 21:01:56 -04:00
David Lechner
2a610267eb gdk/wayland/cursor/os-compatibility: fix build when memfd_create is not available
When building for homebrew/linuxbrew on Ubuntu 16.04, memfd_create() is
not available and causes the build to fail.

This adds a proper check for the function.
2021-04-27 11:46:39 -05:00
Emmanuele Bassi
dbe4543969 Merge branch 'gtksecurememory-updates' into 'master'
gtksecurememory: Request that secure memory not be dumped to disk

See merge request GNOME/gtk!3452
2021-04-17 23:46:38 +00:00
Jason Francis
b27ec5ebde
meson: check for madvise() 2021-04-17 19:30:20 -04:00
Matthias Clasen
4164abd9f7 build: Quiet the compiler
Don't use -Wnull-dereference when assertions are
disabled, since that causes the compiler to see
NULL everywhere.
2021-04-12 22:11:05 -04:00
Emmanuele Bassi
a871a1bdb5 build: Don't append multiple flags as a string
The gtk_debug_cflags variable is an array, with each argument stored in
a separate string; if we add multiple arguments inside the same string
we break the escaping rules.

Fixes: #3864
2021-04-12 21:23:57 -04:00
Chun-wei Fan
65b35457fd meson.build: Check for F16C on 32-bit Visual Studio
It is also possible to enable F16C instructions on 32-bit Visual Studio builds,
so also check for the compiler's ability to build F16C code on Visual Studio
32-bit instead of just bailing out.
2021-04-12 18:13:42 +08:00
Chun-wei Fan
6d6c8c59eb meson.build: Improve F16C detection on Visual Studio
The __builtin_cpu...() intrisics are strictly for GCC/CLang-based compilers, so
don't use them in the checking code on Visual Studio.  The test code will still
compile without this change, but will certainly fail if we want it to link.
2021-04-12 18:13:42 +08:00
Matthias Clasen
885a6b8ebc gsk: Add runtime checks for F16C
Use an IFUNC resolver to determine whether we can use
intrinsics for FP16 conversion. This requires the functions
to be no longer inline.

Sadly, it turns out that __builtin_cpu_supports ("f16c")
doesn't compile on the systems where we want it to prevent
us from getting a SIGILL at runtime.
2021-04-07 22:21:23 -04:00
Matthias Clasen
9d81c129fc Add an option to disable F16C
And add a compile time check for the presence of this
CPU feature.
2021-04-07 22:21:23 -04:00
Matthias Clasen
ccbbc2f2ba 4.2.0 2021-03-30 11:00:55 -04:00
Emmanuele Bassi
5da3308572 build: Dist the API references
Copy them into the dist root from the build root, so that they will be
available in the release archive.
2021-03-30 15:42:40 +01:00
Matthias Clasen
2496ab0902 Be explicit when building gdk-pixbuf subproject
We require png and jpeg loaders.
2021-03-25 22:52:30 -04:00
Matthias Clasen
d882def373 Merge branch 'meson-install-script' into 'master'
Meson: Use gnome.install_script()

See merge request GNOME/gtk!3135
2021-03-22 12:45:45 +00:00
Matthias Clasen
df4b564d69 build: Disable g_assert in release builds
The ngl renderer is heavily using g_assert, and it
is written with the assumption that these assertions
will be compiled out in release builds.
2021-03-21 16:05:10 -04:00
Matthias Clasen
cbda61d3fb 4.1.2 2021-03-14 21:48:48 -04:00
Emmanuele Bassi
0ba2a3a191 Generate GTK API reference(s) with gi-docgen
Stop using gtk-doc, and switch to gi-docgen.

The gi-docgen tool generates API references through the introspection
data, which has various benefits:

 - it does not parse C code
 - it does not generate and run C code to introspect types at build time
 - it does not present a different API from the one we're exporting

Additionally, gi-docgen:

 - does not generate DocBook XML in order to generate HTML
 - does not go through xsltproc
 - parses proper Markdown

Which makes it markedly faster than gtk-doc has ever been.
2021-03-11 16:37:30 +00:00
Xavier Claessens
629e70f89d Meson: Use gnome.post_install()
See https://github.com/mesonbuild/meson/pull/8272 and
https://github.com/mesonbuild/meson/issues/8268.
2021-03-08 21:19:09 -05:00
Xavier Claessens
405dc7f557 meson: override gtk4 dependency
This allows applications that depends on gtk4 to build it as subproject
without hardcoding 'gtk_dep' variable name in their build definition.
2021-03-08 21:06:33 -05:00
BogDan Vatra
72700d1644 Allow GTK4 to be added as a subproject 2021-02-26 09:27:02 +02:00
Matthias Clasen
1f284fcd70 4.1.1 2021-02-23 20:59:16 -05:00
Matthias Clasen
5ff843f97d Stop passing introspection=false to graphene
This should no longer be possible (and the introspection
option is no longer a boolean.
2021-02-12 16:04:15 -05:00
Timm Bäder
6e4bba3d75 build: Check for mallinfo2 instead of mallinfo
Similar to e89fcbfad6
but the tests we use mallinfo() in really aren't important to not worth
the effort to differentiate between mallinfo and mallinfo2. Only check
for mallinfo2().
2021-02-12 08:39:40 +01:00
David Lechner
b509809f34 meson: use correct module file extension on macOS
GModule requires the .so file extension on macOS for historic reasons.
However Meson defaults to .dylib for modules, so we need to override
it to get the correct extension.

Fixes #3645.
2021-02-05 16:54:28 -06:00
Emmanuele Bassi
51bc6ce2e4 build: Disable subproject Cairo tests
There's really no point in running them.
2021-01-29 16:31:10 +00:00
Matthias Clasen
ac0f524722 build: Redo the tools build
Move the tools directory to be toplevel, and instead of
recompiling sources twice, link them with the our new
static libgtk.a.
2021-01-28 12:27:07 -05:00
Matthias Clasen
e6f0103940 Merge branch 'version-bump' into 'master'
Version bump

See merge request GNOME/gtk!3093
2021-01-19 04:48:26 +00:00
Matthias Clasen
ee43a6a603 Bump version to 4.1
master is now open for 4.2 API additions.

Includes an update for the one test we have that
has the version number in its expected output.
2021-01-18 23:09:44 -05:00
Matthias Clasen
1edbc1f1f9 Merge branch 'wip/jtojnar/fix-pc-vulcan' into 'master'
build: Use Meson’s module for building .pc files

Closes #3517

See merge request GNOME/gtk!3005
2021-01-19 04:04:34 +00:00
Matthias Clasen
146b4c93ba 4.0.2 2021-01-18 22:23:57 -05:00
Matthias Clasen
13ef82fc4d dist: Add a dist script to generate css
When I added the sassc option, I failed to ensure that
the theme css is included in the tarballs. This is required
to make tarball builds with -Dsassc=disabled work.
2021-01-12 08:42:18 -05:00
Matthias Clasen
60835227a1 4.0.1 2021-01-09 01:30:13 -05:00
Matthias Clasen
77feb51b9c Pass coretext=enabled to harfbuzz
When we use harfbuzz as a subproject on OS X,
we (or rather, pango) need coretext support.
2021-01-03 21:34:04 -05:00
Matthias Clasen
d55f938f7c printing: cairo-pdf is needed
The print backends need cairos pdf support, which is
contingent on zlib, so enable that when using cairo
as a subproject, as we do in ci for MacOS.
2021-01-03 21:34:04 -05:00
Matthias Clasen
45bb4dc80c ci: Add a macos build
Most of this is cribbed from glib.

We don't use COMMON_MESON_FLAGS here, since disabling
-Werror one subproject at a time is too painful for
all the promoted sub-sub-projects. This needs a better
solution in meson.

Since this is a full rebuild of the entire stack, limit
this to master and merge requests.
2021-01-03 21:34:04 -05:00
Jan Tojnar
7d5826ccf7
build: Fix vulkan reference in pc file
A mistake in string concatenation caused the vulcan dependency to be omitted.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3517
2020-12-27 06:42:29 +01:00
Jan Tojnar
2c9f2325e2
build: Use Meson’s module for building .pc files
Using the module will prevent trivial bugs caused by incorrect string concatenation.

This is just a literal translation. In the future we might rely on Meson auto-detecting fields from library declaration.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3517
2020-12-27 06:27:59 +01:00
Emmanuele Bassi
fa35e3b874 Pass the bindir to the post-install script 2020-12-20 16:33:25 +00:00
Emmanuele Bassi
2da8d9b0ac Do not build gdk-pixbuf's man page
When using it as a sub-project. We don't really need them.
2020-12-17 20:50:16 +00:00
Matthias Clasen
591c2f0595 4.0 2020-12-16 12:12:58 -05:00
Emmanuele Bassi
618186723a build: Remove unused backend_immodules variable
We don't have input method modules any more.
2020-12-15 11:20:19 +00:00
Emmanuele Bassi
a5986f0dcd build: Use get_supported_link_arguments()
Instead of hand-coding it ourselves, let Meson deal with linker
arguments discovery.
2020-12-15 11:19:39 +00:00
Emmanuele Bassi
2457f3d54c build: Bump up the SONAME for GTK4
We released all the 3.9x development snapshots using:

  libgtk-4.0.so.0.xxxx.y

which means that the 4.0.0 release of GTK will have a lower SONAME than
the snapshots. To avoid that, bump the SONAME to 1.xxxx.y.

Fixes: #3392
2020-12-09 12:19:50 +00:00
Emmanuele Bassi
1cc207af32 build: Tie interface age to the development cycle
We don't want to increase the interface age manually, because we're
going to end up forgetting about it.

Instead, we should tie it to the rest of the version:

 - in stable (even minor) cycles, we don't add new API; the interface
   age is the same as the micro version
 - in unstable (odd minor) cycles, every new release might have new API,
   or updates to newly added API; keep the interface age to 0

This removes one more manual thing to change during release, and keeps
us honest with our promise not to add symbols during stable cycles.
2020-12-09 12:19:50 +00:00
Matthias Clasen
398a74d871 3.99.5 2020-12-08 10:58:40 -05:00
Emmanuele Bassi
803b147483 Disable deprecation warnings from GLib
We don't want to test the latest changes in GLib in our own build.
2020-11-23 13:04:11 +00:00
Emmanuele Bassi
de7833b6a0 Use the right GLib macros for version checking
There's a typo in the name, and we never noticed.
2020-11-23 12:06:22 +00:00
Matthias Clasen
3eaae748d3 3.99.4 2020-11-04 21:46:10 -05:00
Xavier Claessens
6ae9f7e7c3 meson: Simplify xinerama dependency check 2020-10-17 09:54:47 -04:00
Xavier Claessens
efbbfb6547 meson: Simplify how cairo dependencies are checked
There is no reason to fallback to find_library for cairo and still rely
on pkg-config for all other dependencies, and just when using MSVC. When
building and pkg-config is not working it is preferable to fallback to a
subproject just like for all other dependencies.

Also add cairo.wrap now that meson support has been merged upstream.
2020-10-17 09:54:47 -04:00
Matthias Clasen
1021e12121 3.99.3 2020-10-15 23:03:03 -04:00
Xavier Claessens
fe89fd2317 meson: Fix error when epoxy is a subproject on Windows
epoxy_dep cannot be used in a configure time check when it comes from a
subproject. Use variables set in pc file instead.

This requires https://github.com/anholt/libepoxy/pull/231.
2020-10-15 08:01:16 -04:00
Timm Bäder
ef7c5747c4 build: Only add -Wcast-align for gcc
Either we or clang needs to get its shit together about this warning.
But using it during development with clang just makes actually usable
warnings get lost in a flood of -Wcast-align warnings.
2020-10-14 15:06:12 -04:00