File: BUILD.gn

package info (click to toggle)
chromium 138.0.7204.157-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,864 kB
  • sloc: cpp: 34,936,859; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,967; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (144 lines) | stat: -rw-r--r-- 3,516 bytes parent folder | download | duplicates (4)
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# 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
    public = [
      "//content/public/common/content_descriptors.h",
      "//content/public/common/content_switches.h",
      "//content/public/common/process_type.h",
    ]

    # Deps required by the above headers.
    public_deps = [
      "//content/public/common:buildflags",
      "//media:media_buildflags",
      "//tools/v8_context_snapshot: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",
      "//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" ]
    }
  }

  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",
  ]
}