chromium/remoting/host/setup/BUILD.gn

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

import("//build/buildflag_header.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//remoting/build/config/remoting_build.gni")

source_set("setup") {
  public_deps = [ ":common" ]
  deps = [ "//remoting/host" ]
}

buildflag_header("buildflags") {
  header = "buildflags.h"
  flags = [ "REMOTING_INTERNAL=$remoting_internal" ]
}

source_set("common") {
  sources = [
    "daemon_controller.cc",
    "daemon_controller.h",
    "me2me_native_messaging_host.cc",
    "me2me_native_messaging_host.h",
    "pin_validator.cc",
    "pin_validator.h",
    "test_util.cc",
    "test_util.h",
  ]

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

  deps = [
    "//base",
    "//extensions/browser/api/messaging:native_messaging",
    "//google_apis",
    "//mojo/core/embedder",
    "//remoting/base:authorization",
    "//remoting/base:base",
    "//remoting/host:common",
    "//remoting/host:resources",
    "//remoting/host/native_messaging",
    "//remoting/protocol:protocol",
    "//services/network/public/cpp",
    "//services/network/public/mojom",
  ]

  if (is_linux || is_chromeos) {
    sources += [
      "daemon_controller_delegate_linux.cc",
      "daemon_controller_delegate_linux.h",
    ]
  }

  if (is_mac) {
    sources += [
      "daemon_controller_delegate_mac.h",
      "daemon_controller_delegate_mac.mm",
    ]
    deps += [
      "//remoting/host/mac:permission_checking",
      "//remoting/resources:strings_grit",
      "//ui/base:base",
    ]
  }

  if (is_apple) {
    deps += [ "//remoting/host/mac:constants" ]
  }

  if (is_win) {
    sources += [
      "daemon_controller_delegate_win.cc",
      "daemon_controller_delegate_win.h",
    ]
    deps += [
      "//remoting/host/win:elevated_native_messaging_host",
      "//remoting/host/win:remoting_lib_idl",
      "//remoting/host/win:security_descriptor",
    ]
  }
}

source_set("start_host_main_headers") {
  sources = [ "start_host_main.h" ]
  deps = [ "//remoting/host:host_main_headers" ]
}

source_set("start_host_common") {
  sources = [
    "host_starter.cc",
    "host_starter.h",
    "host_starter_base.cc",
    "host_starter_base.h",
    "host_starter_oauth_helper.cc",
    "host_starter_oauth_helper.h",
  ]

  deps = [
    ":common",
    "//google_apis",
    "//net",
    "//remoting/base:base",
    "//remoting/host:common",
    "//services/network:network_service",
    "//services/network/public/cpp:cpp",
  ]
}

source_set("start_host_main") {
  sources = [
    "cloud_host_starter.cc",
    "cloud_host_starter.h",
    "corp_host_starter.cc",
    "corp_host_starter.h",
    "oauth_host_starter.cc",
    "oauth_host_starter.h",
    "start_host_main.cc",
  ]

  if (is_linux) {
    sources += [
      "start_host_as_root.cc",
      "start_host_as_root.h",
    ]
  }

  deps = [
    ":buildflags",
    ":start_host_common",
    "//google_apis",
    "//mojo/core/embedder",
    "//net",
    "//remoting/base:authorization",
    "//remoting/base:base",
    "//remoting/base:breakpad",
    "//remoting/host:common",
    "//remoting/host/setup",
    "//remoting/host/setup:start_host_main_headers",
    "//remoting/proto/google/internal/remoting/cloud/v1alpha:messages",
    "//remoting/proto/remoting/v1:cloud_proto",
    "//services/network:network_service",
    "//services/network/public/cpp:cpp",
    "//third_party/libjingle_xmpp:rtc_xmllite",
    "//third_party/webrtc_overrides:webrtc_component",
  ]

  if (remoting_internal) {
    deps += [ "//remoting/internal/proto" ]
  } else {
    deps += [ "//remoting/proto:internal_stubs" ]
  }

  configs += [
    "//build/config/compiler:wexit_time_destructors",
    "//remoting/build/config:host_implementation",
    "//remoting/build/config:version",
  ]
}

source_set("native_messaging_host_main_headers") {
  sources = [ "me2me_native_messaging_host_main.h" ]
  deps = [ "//remoting/host:host_main_headers" ]
}

source_set("native_messaging_host_main") {
  configs += [
    "//build/config/compiler:wexit_time_destructors",
    "//remoting/build/config:host_implementation",
    "//remoting/build/config:version",
  ]

  sources = [ "me2me_native_messaging_host_main.cc" ]

  deps = [
    ":native_messaging_host_main_headers",
    "//base",
    "//build:chromeos_buildflags",
    "//mojo/core/embedder",
    "//net",
    "//remoting/base",
    "//remoting/base:authorization",
    "//remoting/base:breakpad",
    "//remoting/host",
    "//remoting/host:common",
    "//remoting/host/base",
    "//remoting/host/native_messaging",
    "//remoting/host/setup",
    "//services/network:network_service",
    "//services/network/public/cpp",
    "//services/network/public/mojom",
  ]

  if (is_chromeos_ash) {
    deps += [ "//remoting/host/chromeos:browser_interop" ]
  }
}