diff --git a/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb b/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
index 95accfc184..725fcf009e 100644
--- a/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
+++ b/meta/recipes-graphics/xorg-lib/libxkbcommon_1.3.1.bb
@@ -15,11 +15,14 @@ UPSTREAM_CHECK_URI = "http://xkbcommon.org/"
 
 inherit meson pkgconfig
 
-EXTRA_OEMESON = "-Denable-docs=false -Denable-xkbregistry=false"
+EXTRA_OEMESON = "-Denable-xkbregistry=false"
 
 PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland', d)}"
-PACKAGECONFIG[x11] = "-Denable-x11=true,-Denable-x11=false,libxcb xkeyboard-config,"
+PACKAGECONFIG:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'docs', '', d)}"
+
+PACKAGECONFIG[docs] = "-Denable-docs=true,-Denable-docs=false,doxygen-native"
 PACKAGECONFIG[wayland] = "-Denable-wayland=true,-Denable-wayland=false,wayland-native wayland wayland-protocols,"
+PACKAGECONFIG[x11] = "-Denable-x11=true,-Denable-x11=false,libxcb xkeyboard-config,"
 
 # Fix a following runtime error:
 # xkbcommon: ERROR: couldn't find a Compose file for locale "C"
