Move protocol dependency information from a separate dict in
tests/meson.build into the main protocol dictionaries in meson.build.
Each protocol's value is now a dict mapping version to a list of
dependency file paths, making dependencies visible alongside the
protocol definitions.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Now that dependent protocol code is linked into test executables, all
cross-protocol symbols are properly resolved. The
--unresolved-symbols=ignore-all workaround is no longer needed and was
not effective with LLVM's LLD linker or on musl systems without lazy
binding.
Closes: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/48
Signed-off-by: Matt Turner <mattst88@gmail.com>
Some protocols reference interfaces defined in other protocols (e.g.,
xdg-decoration references xdg_toplevel from xdg-shell). When built in
isolation, these produce undefined symbols.
Define a dependency map and link the generated code from depended-on
protocols into each test executable, properly resolving all
cross-protocol symbol references.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Split the single foreach loop into two passes to allow test executables
to reference generated code from other protocols. The first pass
generates scanner outputs and records the custom_targets in
dictionaries. The second pass builds the test executables.
No functional change.
Signed-off-by: Matt Turner <mattst88@gmail.com>
Generate and install headers containing enums. See [1].
Meson requires us to generate headers in a "include/wayland-protocols"
directory, so that include paths can be properly set up when used
as a sub-project.
[1]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/312
Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes the following warning:
NOTICE: Future-deprecated features used:
* 0.55.0: {'ExternalProgram.path'}
* 0.56.0: {'dependency.get_pkgconfig_variable'}
Signed-off-by: Simon Ser <contact@emersion.fr>
When linking for macOS, this linker flag is rejected. Instead of
always passing it, we can check whether it is supported first.
Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Simon Ser <contact@emersion.fr>
I am trying to cross-compile from macOS for FreeBSD and this is currently
failing since the tests attempt to build a native binary that links
against the wayland-client and wayland-server libraries for the FreeBSD
system. I believe we should be building them for the target system and
not the current host (especially since there is no way to build
wayland-client and wayland-server for macOS, but I do want to check that
the files build correctly for FreeBSD).
Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Reviewed-by: Simon Ser <contact@emersion.fr>
We use the no-op executables in test() directives, so these will be
run on the host. This fixes the following warning:
tests/meson.build:23: WARNING: add_languages is missing native:, assuming
languages are wanted for both host and build.
Signed-off-by: Simon Ser <contact@emersion.fr>
When we're building C++ test executables, make sure we pull in the
correct libwayland headers, to avoid trying to compile against a version
different from the scanner we built it against.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Stop hardcoding the Python path to /usr/bin/python3. Not all systems
have Python installed to /usr/bin, and some users might have installed
Python to a custom location.
Instead, use /usr/bin/env, which performs a $PATH lookup to find the
Python executable.
Signed-off-by: Issam E. Maghni <issam.e.maghni@mailbox.org>
Pass --strict to wayland-scanner in order to make it exit with failure
if something wasn't correct.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
The wayland-scanner sub-commands private-code and public-code replaced
the old code command, so lets use those in the tests instead.
This requires at least wayland-scanner 1.15.0.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
We can now test all the protocol files by running make check (or distcheck)
which will pass them through the scanner.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jonas Ådahl <jadahl@gmail.com>