chromium/remoting/client/display/BUILD.gn

# Copyright 2014 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# TODO(yuweih): This doesn't build on CrOS. crbug.com/869578
source_set("display") {
  sources = [
    "canvas.h",
    "drawable.h",
    "gl_canvas.cc",
    "gl_canvas.h",
    "gl_cursor.cc",
    "gl_cursor.h",
    "gl_cursor_feedback.cc",
    "gl_cursor_feedback.h",
    "gl_cursor_feedback_texture.cc",
    "gl_cursor_feedback_texture.h",
    "gl_desktop.cc",
    "gl_desktop.h",
    "gl_helpers.cc",
    "gl_helpers.h",
    "gl_math.cc",
    "gl_math.h",
    "gl_render_layer.cc",
    "gl_render_layer.h",
    "gl_renderer.cc",
    "gl_renderer.h",
    "renderer_proxy.cc",
    "renderer_proxy.h",
    "sys_opengl.h",
  ]

  public_deps = [ "//remoting/proto" ]
  deps = [
    "//base",
    "//remoting/base",
    "//remoting/client/ui:ui_manipulation",
    "//third_party/angle:includes",
    "//third_party/libyuv",
    "//third_party/protobuf:protobuf_lite",
    "//third_party/webrtc_overrides:webrtc_component",
  ]

  if (is_android) {
    libs = [ "GLESv2" ]
  }

  if (is_linux || is_chromeos) {
    libs = [ "GL" ]
  }

  if (is_mac) {
    frameworks = [ "OpenGL.framework" ]

    defines = [ "GL_SILENCE_DEPRECATION" ]
  }

  if (is_ios) {
    frameworks = [
      "GLKit.framework",
      "OpenGLES.framework",
    ]

    # TODO(crbug.com/40589733) fix for OpenGLES deprecation.
    defines = [ "GLES_SILENCE_DEPRECATION" ]
  }

  if (is_win) {
    deps += [ "//third_party/angle:libGLESv2" ]
  }
}

if (is_win) {
  # Windows clang builder fails to link the test binary with ANGLE GLESv2.
  # crbug.com/642027
  group("unit_tests") {
    deps = []
  }
} else {
  source_set("unit_tests") {
    testonly = true

    sources = [
      "fake_canvas.cc",
      "fake_canvas.h",
      "gl_renderer_unittest.cc",
    ]

    configs += [ "//remoting/build/config:version" ]

    deps = [
      ":display",
      "//base",
      "//base/test:test_support",
      "//remoting/proto",
      "//testing/gmock",
      "//testing/gtest",
      "//third_party/webrtc_overrides:webrtc_component",
    ]
  }
}