Skip to content

Forced X11 header inclusion on GNU/Linux is wrong #87

@vanfanel

Description

@vanfanel

Hi there,

I was building a project that depends on plume (Goemon64Recomp), and I got an error:

/home/manuel/src/n64recomp/Goemon64Recomp/lib/rt64/src/contrib/plume/plume_render_interface_types.h:23:10: fatal error: 'X11/Xlib.h' file not found
   23 | #include "X11/Xlib.h"
      |          ^~~~~~~~~~~~

That comes from here:

#elif defined(__linux__)

That assumes that Linux=X11, which is not correct on modern GNU/Linux, where X11 may or may NOT be present (all major distros use Wayland by default now, with X11 being supported in legacy mode via xwayland).

This wrong assumption that Linux=X11 is again made here:

#define VK_USE_PLATFORM_XLIB_KHR

And here:
VK_KHR_XLIB_SURFACE_EXTENSION_NAME,

And here:
surfaceCreateInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR;

All in all, VK_USE_PLATFORM_WAYLAND_KHR should be the default nowadays instead of VK_USE_PLATFORM_XLIB_KHR: X11 is legacy by now, and in fact it's on way out on some of the most popular distros (see: https://discourse.gnome.org/t/gnome-50-alpha-released/33616).
But if X11 compatibility is to be kept, at least some cmake configuration option like -DUSE_LEGACY_X11=ON to use X11 instead of Wayland should be provided, I guess.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions