unplugged-system/external/cronet/components/nacl/common/BUILD.gn

155 lines
3.6 KiB
Plaintext

# 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("//components/nacl/features.gni")
import("//components/nacl/toolchain.gni")
import("//mojo/public/tools/bindings/mojom.gni")
if (enable_nacl) {
# This is separate so it can be used by ../broker:nacl64.
static_library("minimal") {
sources = [
"nacl_cmd_line.cc",
"nacl_cmd_line.h",
"nacl_constants.cc",
"nacl_constants.h",
"nacl_messages.cc",
"nacl_messages.h",
"nacl_process_type.h",
"nacl_service.cc",
"nacl_service.h",
"nacl_types.cc",
"nacl_types.h",
"nacl_types_param_traits.cc",
"nacl_types_param_traits.h",
]
public_deps = [
":minimal_content_dummy",
":switches",
"//ipc",
"//sandbox/policy",
]
deps = [
"//base",
"//base:base_static",
"//content/public/common:content_descriptors",
"//mojo/core/embedder",
"//native_client/src/trusted/error_code",
"//services/service_manager/public/cpp",
]
}
# This exists just to make 'gn check' happy with :minimal. It can't
# depend on //content/public/common or anything like that, because that
# would bring in lots more than counts as "minimal" (stuff that should
# not be in the nacl64.exe build).
source_set("minimal_content_dummy") {
check_includes = false
sources = [
"//content/public/common/content_descriptors.h",
"//content/public/common/content_switches.h",
"//content/public/common/process_type.h",
]
# Deps required by the above headers.
deps = [ "//media:media_buildflags" ]
}
static_library("common") {
sources = [
"nacl_host_messages.cc",
"nacl_host_messages.h",
"pnacl_types.cc",
"pnacl_types.h",
]
public_deps = [
":minimal",
":mojo_bindings",
":switches",
"//ipc",
]
deps = [
"//base",
"//build:chromeos_buildflags",
"//url",
"//url/ipc:url_ipc",
]
if (is_linux || is_chromeos) {
sources += [
"nacl_paths.cc",
"nacl_paths.h",
]
defines = [ "__STDC_LIMIT_MACROS=1" ]
deps += [ "//content/common:sandbox_support_linux" ]
}
}
source_set("debug_exception_handler") {
sources = []
deps = [ "//base" ]
if (is_win) {
sources += [
"nacl_debug_exception_handler_win.cc",
"nacl_debug_exception_handler_win.h",
]
}
}
mojom("mojo_bindings") {
sources = [ "nacl.mojom" ]
cpp_typemaps = [
{
types = [
{
mojom = "nacl.mojom.NaClErrorCode"
cpp = "::NaClErrorCode"
},
]
traits_headers =
[ "//native_client/src/trusted/service_runtime/nacl_error_code.h" ]
traits_private_headers =
[ "//components/nacl/common/nacl_types_param_traits.h" ]
traits_public_deps = [
":minimal",
"//native_client/src/trusted/error_code",
]
traits_deps = [ "//ipc" ]
},
]
}
}
# Depending on this allows targets to unconditionally include
# nacl_process_type.h without testing whether nacl is enabled.
source_set("process_type") {
public = [ "nacl_process_type.h" ]
deps = [ "//content/public/common" ]
}
static_library("switches") {
sources = [
"nacl_switches.cc",
"nacl_switches.h",
]
}
buildflag_header("buildflags") {
header = "buildflags.h"
flags = [
"ENABLE_NACL=$enable_nacl",
"IS_MINIMAL_TOOLCHAIN=$is_minimal_toolchain",
]
}