blob: fca3ec3e9277a789420b8912b52569427f21d761 [file] [log] [blame]
# 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("//extensions/shell/app_shell.gni")
# Technically, this directory should not depend on files from src/chrome, but
# that's where the VERSION file is. This should probably all be moved to
# src/build.
import("//chrome/version.gni")
import("//testing/test.gni")
import("//tools/grit/grit_rule.gni")
assert(enable_extensions)
grit("resources") {
source = "app_shell_resources.grd"
outputs = [
"grit/app_shell_resources.h",
"app_shell_resources.pak",
]
}
source_set("app_shell_lib") {
# TODO(jamescook): investigate and get rid of test dependencies. This library
# is testonly because it depends on testonly libraries, namely
# //content/shell:content_shell_lib. See http://crbug.com/438283
testonly = true
deps = [
":resources",
":version_header",
"//base",
"//components/devtools_discovery",
"//components/devtools_http_handler",
"//components/guest_view/browser",
"//components/guest_view/common",
"//components/guest_view/renderer",
"//components/pref_registry",
"//components/prefs",
"//components/update_client",
"//components/user_prefs",
"//components/web_cache/renderer",
"//content",
"//content/shell:content_shell_lib",
"//device/core",
"//device/hid",
"//extensions:extensions_resources",
"//extensions:shell_and_test_pak",
"//extensions/browser",
"//extensions/common",
"//extensions/common/api",
"//extensions/common/api:api_registration",
"//extensions/renderer",
"//extensions/shell/common/api",
"//extensions/shell/common/api:api_registration",
"//extensions/utility",
"//mojo/edk/system",
"//skia",
"//third_party/WebKit/public:blink",
"//ui/base",
"//ui/base/ime",
"//v8",
]
sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources,
".",
"//extensions/shell")
if (use_aura) {
deps += [ "//ui/wm" ]
aura_sources = rebase_path(app_shell_gypi_values.app_shell_lib_sources_aura,
".",
"//extensions/shell")
sources += aura_sources
}
if (is_chromeos) {
deps += [
"//chromeos",
"//ui/chromeos:ui_chromeos",
"//ui/display",
]
chromeos_sources =
rebase_path(app_shell_gypi_values.app_shell_lib_sources_chromeos,
".",
"//extensions/shell")
sources += chromeos_sources
}
if (enable_nacl) {
sources += [
"browser/shell_nacl_browser_delegate.cc",
"browser/shell_nacl_browser_delegate.h",
]
deps += [
"//components/nacl/browser",
"//components/nacl/common",
"//components/nacl/loader",
"//components/nacl/renderer",
"//components/nacl/renderer/plugin:nacl_trusted_plugin",
]
if (is_linux) {
deps += [
"//components/nacl/loader:helper_nonsfi",
"//components/nacl/loader:nacl_helper",
]
}
}
if (cld_version == 2) {
deps += [ "//third_party/cld_2:cld2_platform_impl" ]
}
}
if (!(is_chromeos && !use_ozone)) {
executable("app_shell") {
# testonly because :app_shell_lib is testonly. See :app_shell_lib comment.
testonly = true
sources = rebase_path(app_shell_gypi_values.app_shell_sources,
".",
"//extensions/shell")
deps = [
":app_shell_lib",
"//build/config/sanitizers:deps",
"//extensions:shell_and_test_pak",
]
if (is_win) {
configs += [ "//build/config/win:windowed" ]
configs -= [ "//build/config/win:console" ]
}
if (is_mac) {
# TODO(GYP) bug 546894: Fix GN and toolchains to handle spaces here.
#output_name = "App Shell"
# TODO(GYP): Mac bundling. See also content_shell which this is basically
# a copy-paste of.
deps += [ ":app_shell_framework" ]
# TODO(GYP): Mac app_shell_helper stuff.
}
}
}
test("app_shell_unittests") {
sources = rebase_path(app_shell_gypi_values.app_shell_unittests_sources,
".",
"//extensions/shell")
data = [
"//extensions/test/data/",
"$root_out_dir/extensions_shell_and_test.pak",
#"$root_out_dir/natives_blob.bin", # move to gin
#"$root_out_dir/snapshot_blob.bin",
]
deps = [
":app_shell_lib",
"//base",
"//base/test:test_support",
"//content/test:test_support",
"//extensions:shell_and_test_pak",
"//extensions:test_support",
"//testing/gtest",
]
data_deps = [
# "//gin", # TODO(dpranke): Either gin or v8 data is needed ...
"//third_party/mesa:osmesa",
]
if (use_aura) {
deps += [ "//ui/aura:test_support" ]
aura_sources =
rebase_path(app_shell_gypi_values.app_shell_unittests_sources_aura,
".",
"//extensions/shell")
sources += aura_sources
}
if (is_chromeos) {
deps += [ "//chromeos:test_support_without_gmock" ]
chromeos_sources =
rebase_path(app_shell_gypi_values.app_shell_unittests_sources_chromeos,
".",
"//extensions/shell")
sources += chromeos_sources
}
# TODO(GYP): Enable this when //components/nacl GN is done.
if (false) {
if (use_nacl) {
nacl_sources =
rebase_path(app_shell_gypi_values.app_shell_unittests_sources_nacl,
".",
"//extensions/shell")
sources += nacl_sources
}
}
}
process_version("version_header") {
template_file = "common/version.h.in"
output = "$target_gen_dir/common/version.h"
}
if (is_mac) {
# TODO(GYP) this should be a bundle. Lots of other stuff in this target.
# Should be able to copy content shell framework (this is basically a
# copy-paste of that target).
shared_library("app_shell_framework") {
testonly = true
sources = [
"app/shell_main_mac.cc",
"app/shell_main_mac.h",
]
deps = [
":app_shell_lib",
]
}
}