diff --git a/modules/desktop_capture/BUILD.gn b/modules/desktop_capture/BUILD.gn index e6797bf771..59f4ab0083 100644 --- a/modules/desktop_capture/BUILD.gn +++ b/modules/desktop_capture/BUILD.gn @@ -366,7 +366,7 @@ rtc_static_library("desktop_capture_generic") { ] } - if (rtc_use_x11 || rtc_use_pipewire) { + if (rtc_use_x11_extensions || rtc_use_pipewire) { sources += [ "mouse_cursor_monitor_linux.cc", "screen_capturer_linux.cc", @@ -378,7 +378,7 @@ rtc_static_library("desktop_capture_generic") { } } - if (rtc_use_x11) { + if (rtc_use_x11_extensions) { sources += [ "linux/mouse_cursor_monitor_x11.cc", "linux/mouse_cursor_monitor_x11.h", @@ -401,7 +401,14 @@ rtc_static_library("desktop_capture_generic") { "linux/x_window_property.cc", "linux/x_window_property.h", ] - configs += [ "//build/config/linux:x11" ] + libs = [ + "X11", + "Xcomposite", + "Xdamage", + "Xext", + "Xfixes", + "Xrender", + ] if (build_with_mozilla) { sources += [ @@ -414,7 +421,7 @@ rtc_static_library("desktop_capture_generic") { } } - if (!is_win && !is_mac && !rtc_use_x11 && !rtc_use_pipewire) { + if (!is_win && !is_mac && !rtc_use_x11_extensions && !rtc_use_pipewire) { sources += [ "mouse_cursor_monitor_null.cc", "screen_capturer_null.cc", diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn index a3dd22eee1..86dee935cf 100644 --- a/rtc_base/BUILD.gn +++ b/rtc_base/BUILD.gn @@ -950,17 +950,6 @@ rtc_static_library("rtc_base") { deps += [ "system:cocoa_threading" ] } - if (rtc_use_x11) { - libs += [ - "dl", - "rt", - "Xext", - "X11", - "Xcomposite", - "Xrender", - ] - } - if (is_linux) { libs += [ "dl", diff --git a/webrtc.gni b/webrtc.gni index 6ba8d0aeb3..3a8592ddcf 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -242,6 +242,10 @@ declare_args() { # Include tests in standalone checkout. rtc_include_tests = !build_with_chromium && !build_with_mozilla + + # Set this to false to skip building code that also requires X11 extensions + # such as Xdamage, Xfixes. + rtc_use_x11_extensions = rtc_use_x11 } # Make it possible to provide custom locations for some libraries (move these @@ -250,8 +254,9 @@ rtc_libvpx_dir = "//third_party/libvpx" rtc_opus_dir = "//third_party/opus" # Desktop capturer is supported only on Windows, OSX and Linux. -rtc_desktop_capture_supported = (is_win && current_os != "winuwp") || is_mac || - (is_linux && (rtc_use_x11 || rtc_use_pipewire)) +rtc_desktop_capture_supported = + (is_win && current_os != "winuwp") || is_mac || + (is_linux && (rtc_use_x11_extensions || rtc_use_pipewire)) ############################################################################### # Templates