--- a/tools/depends/target/ffmpeg/CMakeLists.txt
+++ b/tools/depends/target/ffmpeg/CMakeLists.txt
@@ -74,6 +74,11 @@ if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
   else()
     list(APPEND ffmpeg_conf --disable-vdpau)
   endif()
+  if ("x11" IN_LIST CORE_PLATFORM_NAME_LC)
+    list(APPEND ffmpeg_conf --enable-xlib)
+  else()
+    list(APPEND ffmpeg_conf --disable-xlib)
+  endif()
 elseif(CORE_SYSTEM_NAME STREQUAL android)
   list(APPEND ffmpeg_conf --target-os=android
                           --extra-libs=-liconv
