summaryrefslogtreecommitdiffstats
path: root/remoting/host/BUILD.gn
blob: 12c6bd05e8e26a29063928d65bded17015f9d0b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//remoting/remoting_version.gni")

static_library("host") {
  gypi_values = exec_script("//build/gypi_to_gn.py",
                            [ rebase_path("../remoting_host_srcs.gypi") ],
                            "scope",
                            [ "../remoting_host_srcs.gypi" ])

  sources = rebase_path(gypi_values.remoting_host_sources, ".", "//remoting")

  libs = []

  configs += [ "//build/config/compiler:wexit_time_destructors" ]

  defines = [ "WEBRTC_CHROMIUM_BUILD" ]

  deps = [
    "//base:i18n",
    "//components/policy:policy",
    "//components/policy:policy_component_common",
    "//crypto",
    "//google_apis",
    "//ipc",
    "//remoting/base",
    "//remoting/protocol",
    "//remoting/resources",
    "//ui/events/platform",
    "//ui/events:dom4_keycode_converter",
  ]

  if (is_linux) {
    libs += [ "pam" ]
  }

  if (use_x11) {
    configs += [
      #TODO : (kelvinp) Add GTK to the configs.
      "//build/config/linux:x11",
    ]
  } else {
    sources -= [
      "clipboard_x11.cc",
      "linux/x_server_clipboard.cc",
      "linux/x_server_clipboard.h",
    ]
  }

  if (is_chromeos) {
    deps += [
      "//cc",
      "//ppapi/host",
      "//skia",
      "//ui/aura",
      "//ui/compositor",
      "//ui/events",
      "//ui/views",
    ]

    if (use_ash) {
      deps += [ "//ash" ]
    }

    if (use_ozone) {
      sources -= [ "input_injector_x11.cc" ]
      deps += [ "//ui/ozone" ]
    } else {
      sources -= [
        "clipboard_x11.cc",
        "input_injector_chromeos.cc",
        "input_injector_chromeos.h",
        "linux/x_server_clipboard.cc",
        "linux/x_server_clipboard.h",
      ]
    }

    sources -= [
      "continue_window_linux.cc",
      "disconnect_window_linux.cc",
      "local_input_monitor_x11.cc",
      "remoting_me2me_host.cc",
    ]
  }

  if (is_mac) {
    defines += [
      "HOST_BUNDLE_NAME=\"$host_bundle_name\"",
      "PREFPANE_BUNDLE_NAME=\"$prefpane_bundle_name\"",
    ]

    libs += [
      "Accelerate.framework",
      "libpam.a",
    ]

    deps += [ "//google_toolbox_for_mac" ]
  }

  if (enable_webrtc) {
    deps += [
      "//third_party/libjingle:libpeerconnection",
      "//third_party/webrtc/modules/desktop_capture",
    ]

    sources += rebase_path(gypi_values.remoting_cast_sources, ".", "//remoting")
  }
}