xorg depends on mesa, even when not actually needed, like with nvidia gpu's
I explained the issue here: https://forums.gentoo.org/viewtopic-t-1167405.html It seems wasteful to me to have to build mesa when my gpu won't actually make use of mesa.
In that forum post I described a minimal build of xorg, but a regular or "full" build of xorg also works fine without mesa:
meson setup --libdir lib64 --localstatedir /var/lib --prefix /usr --sysconfdir /etc --wrap-mode nodownload --build.pkg-config-path /usr/share/pkgconfig --pkg-config-path /usr/share/pkgconfig --native-file /var/tmp/portage/x11-base/xorg-server-21.1.11/temp/meson.x86_64-pc-linux-gnu.amd64.ini -Db_pch=false -Dwerror=false -Db_lto=false --buildtype plain --localstatedir /var --sysconfdir /etc/X11 --buildtype plain -Db_ndebug=true -Ddri1=true -Ddri2=true -Ddri3=true -Dglamor=true -Dglx=true -Dudev=false -Dudev_kms=false -Dlibunwind=false -Dxcsecurity=true -Dxselinux=false -Dxephyr=true -Dxnest=true -Dxorg=true -Dxvfb=true -Ddocs=false -Ddrm=true -Ddtrace=false -Dipv6=true -Dhal=false -Dlinux_acpi=false -Dlinux_apm=false -Dsecure-rpc=false -Dsha1=libcrypto -Dxkb_output_dir=/var/lib/xkb -Dsystemd_logind=false -Dsuid_wrapper=false
Which means the following USE flags on gentoo:
USE="xcsecurity xephyr xnest xorg xvfb -debug -elogind -minimal (-selinux) -suid -systemd -test -udev -unwind"
The others are off not because they don't work, but because I didn't/can't test them.