# The privileged drmtap-helper is opt-out: it is built by default, but ONLY with
# its confinement in place. Its two confinement dependencies (libseccomp for the
# seccomp allowlist, libcap for dropping all caps but CAP_SYS_ADMIN) are therefore
# mandatory whenever the helper is built — an unconfined helper is never produced.
#   'enabled' : build the helper; hard-fail if libseccomp/libcap are missing.
#   'auto'    : build the helper if libseccomp/libcap are present; otherwise skip
#               it (build the library only) rather than ship it unconfined.
#   'disabled': no helper at all — the binary is not built, AND the library is
#               compiled with no fork/exec path, so `nm -D` on the .so shows no
#               fork, exec or socketpair and the search paths are not in it
#               either. For a consumer whose device access is already arranged
#               another way (udev rules, video/render membership, seat
#               management), that removes a privileged binary it never wanted to
#               have to trust. A caller without CAP_SYS_ADMIN then gets -EACCES
#               naming the missing capability, instead of a silent fallback.
#               NOTE: 'auto' with libseccomp/libcap missing is NOT this. It only
#               means this host cannot produce a confined helper; the library
#               keeps its client side so a helper installed from elsewhere still
#               works.
option('helper', type: 'feature', value: 'auto',
    description: 'Build the privileged drmtap-helper (requires libseccomp + libcap)')

# The EGL/GLES2 detiling backend is the SHIPPED hot path: a tiled or compressed
# scanout is detiled on the GPU there, and without it libdrmtap falls back to the
# CPU deswizzle or fails. It is opt-out for the same reason the helper is, some
# build hosts genuinely have no EGL headers, but a build that silently produces
# the stub is a trap: nothing downstream notices until a real scanout arrives.
#   'enabled' : hard-fail if the egl/glesv2 headers are missing.
#   'auto'    : use them if present, build the stub otherwise (historical default).
#   'disabled': build the stub even where the headers exist.
option('egl', type: 'feature', value: 'auto',
    description: 'Build the EGL/GLES2 GPU detiling backend (requires egl + glesv2 headers)')
