From 0d729b3039fe96b74e3efc80449c6a9cf28a04ba Mon Sep 17 00:00:00 2001 From: ehmaldonado Date: Fri, 10 Feb 2017 01:38:23 -0800 Subject: [PATCH] Check for use_x11 before runnig desktop_capture_modules_tests on linux. The tests need "x11/shared_x_display.h" which is not included when use_x11 is false and we're on linux. The problem is: screen_capturer_integration_test.cc - requires -> screen_drawer.h - requires -> screen_drawer_linux.cc - requires -> x11/shared_x_display.h which is not included when use_x11 is false. BUG=None NOTRY=True Review-Url: https://codereview.webrtc.org/2684683003 Cr-Commit-Position: refs/heads/master@{#16529} --- webrtc/modules/desktop_capture/BUILD.gn | 54 ++++++++++++------------- webrtc/webrtc.gni | 3 +- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn index bbf9ac57bb..6e7e9bcf39 100644 --- a/webrtc/modules/desktop_capture/BUILD.gn +++ b/webrtc/modules/desktop_capture/BUILD.gn @@ -57,39 +57,37 @@ if (rtc_include_tests) { rtc_source_set("desktop_capture_unittests") { testonly = true - sources = [] - deps = [] - if (rtc_desktop_capture_supported || is_android) { - deps += [ - ":desktop_capture", - ":primitives", - "../..:webrtc_common", - "../../base:rtc_base_approved", - "../../system_wrappers:system_wrappers", - "../../test:test_support", - "//testing/gmock", - ] - sources += [ - "desktop_region_unittest.cc", - "differ_block_unittest.cc", - ] - } + sources = [ + "desktop_and_cursor_composer_unittest.cc", + "desktop_capturer_differ_wrapper_unittest.cc", + "desktop_frame_rotation_unittest.cc", + "desktop_region_unittest.cc", + "differ_block_unittest.cc", + "mouse_cursor_monitor_unittest.cc", + "rgba_color_unittest.cc", + "test_utils.cc", + "test_utils.h", + "test_utils_unittest.cc", + "win/cursor_unittest.cc", + "win/cursor_unittest_resources.h", + "win/cursor_unittest_resources.rc", + ] + deps = [ + ":desktop_capture", + ":desktop_capture_mock", + ":primitives", + ":rgba_color", + "../..:webrtc_common", + "../../base:rtc_base_approved", + "../../system_wrappers:system_wrappers", + "../../test:test_support", + "//testing/gmock", + ] if (rtc_desktop_capture_supported) { sources += [ - "desktop_and_cursor_composer_unittest.cc", - "desktop_capturer_differ_wrapper_unittest.cc", - "desktop_frame_rotation_unittest.cc", - "mouse_cursor_monitor_unittest.cc", - "rgba_color_unittest.cc", "screen_capturer_helper_unittest.cc", "screen_capturer_mac_unittest.cc", "screen_capturer_unittest.cc", - "test_utils.cc", - "test_utils.h", - "test_utils_unittest.cc", - "win/cursor_unittest.cc", - "win/cursor_unittest_resources.h", - "win/cursor_unittest_resources.rc", "window_capturer_unittest.cc", ] deps += [ ":desktop_capture_mock" ] diff --git a/webrtc/webrtc.gni b/webrtc/webrtc.gni index 4c34eae192..e6d746a49e 100644 --- a/webrtc/webrtc.gni +++ b/webrtc/webrtc.gni @@ -10,6 +10,7 @@ import("//build/config/arm.gni") import("//build/config/features.gni") import("//build/config/mips.gni") import("//build/config/sanitizers/sanitizers.gni") +import("//build/config/ui.gni") import("//build_overrides/build.gni") import("//testing/test.gni") @@ -172,7 +173,7 @@ rtc_libyuv_dir = "//third_party/libyuv" rtc_opus_dir = "//third_party/opus" # Desktop capturer is supported only on Windows, OSX and Linux. -rtc_desktop_capture_supported = is_win || is_mac || is_linux +rtc_desktop_capture_supported = is_win || is_mac || (is_linux && use_x11) ############################################################################### # Templates