chromium/remoting/ios/app/BUILD.gn

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

import("//remoting/build/config/remoting_build.gni")
import("//remoting/ios/app/remoting_ios_tmpl.gni")

group("all") {
  testonly = true

  deps = [ ":ios_remoting_app" ]
}

# TODO(crbug.com/40853188): Migrate away from deprecated MDC APIs.
config("disable_deprecated_declarations") {
  cflags = [ "-Wno-deprecated-declarations" ]
}

# source set to be used by both external and internal app.
source_set("common_source_set") {
  sources = [
    "account_manager.h",
    "account_manager.mm",
    "app_delegate.h",
    "app_delegate.mm",
    "app_initializer.h",
    "app_view_controller.h",
    "client_connection_view_controller.h",
    "client_connection_view_controller.mm",
    "first_launch_view_controller.h",
    "first_launch_view_controller.mm",
    "first_launch_view_presenter.h",
    "first_launch_view_presenter.mm",
    "help_and_feedback.h",
    "help_and_feedback.mm",
    "help_view_controller.h",
    "help_view_controller.mm",
    "host_collection_header_view.h",
    "host_collection_header_view.mm",
    "host_collection_view_cell.h",
    "host_collection_view_cell.mm",
    "host_collection_view_controller.h",
    "host_collection_view_controller.mm",
    "host_fetching_error_view_controller.h",
    "host_fetching_error_view_controller.mm",
    "host_fetching_view_controller.h",
    "host_fetching_view_controller.mm",
    "host_setup_footer_view.h",
    "host_setup_footer_view.mm",
    "host_setup_header_view.h",
    "host_setup_header_view.mm",
    "host_setup_view_cell.h",
    "host_setup_view_cell.mm",
    "host_setup_view_controller.h",
    "host_setup_view_controller.mm",
    "host_view_controller.h",
    "host_view_controller.mm",
    "main.mm",
    "notification_dialog_view_controller.h",
    "notification_dialog_view_controller.mm",
    "notification_presenter.h",
    "notification_presenter.mm",
    "physical_keyboard_detector.h",
    "physical_keyboard_detector.mm",
    "pin_entry_view.h",
    "pin_entry_view.mm",
    "refresh_control_provider.h",
    "refresh_control_provider.mm",
    "remoting_theme.h",
    "remoting_theme.mm",
    "remoting_view_controller.h",
    "remoting_view_controller.mm",
    "session_reconnect_view.h",
    "session_reconnect_view.mm",
    "settings/remoting_settings_view_controller.h",
    "settings/remoting_settings_view_controller.mm",
    "settings/setting_option.h",
    "settings/setting_option.mm",
    "settings/settings_view_cell.h",
    "settings/settings_view_cell.mm",
    "side_menu_items.h",
    "side_menu_items.mm",
    "user_status_presenter.h",
    "user_status_presenter.mm",
    "view_utils.h",
    "view_utils.mm",
    "web_view_controller.h",
    "web_view_controller.mm",
  ]

  deps = [
    "//base",
    "//base:i18n",
    "//google_apis",
    "//remoting/base",
    "//remoting/base:authorization",
    "//remoting/client",
    "//remoting/client/input",
    "//remoting/client/notification",
    "//remoting/ios:ios_core",
    "//remoting/ios/app/resources:assets",
    "//remoting/ios/audio",
    "//remoting/ios/display",
    "//remoting/ios/domain",
    "//remoting/ios/mdc",
    "//remoting/ios/persistence",
    "//remoting/protocol",
    "//remoting/resources",
    "//ui/base",
    "//ui/gfx",
    "//ui/resources",
  ]

  frameworks = [
    "UIKit.framework",
    "AVFoundation.framework",
    "Foundation.framework",
    "WebKit.framework",
    "QuartzCore.framework",
  ]

  # TODO(crbug.com/40589733) fix for OpenGLES deprecation.
  defines = [ "GLES_SILENCE_DEPRECATION" ]
  foreach(locale, remoting_locales_with_underscores) {
    deps += [ "//remoting/ios/app/resources:locale_${locale}_bundle_data" ]
  }

  public_deps = [
    "//ios/third_party/material_components_ios",
    "//remoting/ios/facade",
  ]

  configs += [ ":disable_deprecated_declarations" ]
}

source_set("app_source_set") {
  sources = [
    "account_manager_chromium.h",
    "account_manager_chromium.mm",
    "app_initializer_chromium.mm",
    "refresh_control_provider_chromium.h",
    "refresh_control_provider_chromium.mm",
    "remoting_menu_view_controller.h",
    "remoting_menu_view_controller.mm",
  ]
  deps = [
    ":common_source_set",
    "//base",
    "//google_apis",
    "//remoting/resources",
    "//ui/base",
  ]
  frameworks = [ "UIKit.framework" ]

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

ios_remoting_app_tmpl("ios_remoting_app") {
  output_name = "chromoting"
  info_plist_path = "resources/Info.plist"
  entitlements_path = "resources/Remoting.entitlements"
  deps = [
    ":app_source_set",
    "//ios/third_party/material_components_ios:material_components_ios+link",
    "//remoting/ios/app/resources:launchscreen_assets",
    "//remoting/ios/app/resources:remoting_icons",
  ]

  bundle_deps = [
    "//ios/third_party/material_components_ios:material_components_ios+bundle",
  ]
}