File: extensions.gni

package info (click to toggle)
chromium 138.0.7204.183-1~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 6,080,960 kB
  • sloc: cpp: 34,937,079; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,954; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,811; 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 (73 lines) | stat: -rw-r--r-- 2,461 bytes parent folder | download | duplicates (5)
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
# Copyright 2024 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/apple/compile_entitlements.gni")
import("//build/apple/tweak_info_plist.gni")
import("//build/config/ios/rules.gni")
import("//build/ios/extension_bundle_data.gni")
import("//ios/build/chrome_build.gni")
import("//ios/build/config.gni")

template("browserkit_extension") {
  _process_target = target_name
  tweak_info_plist("tweak_${_process_target}_plist") {
    info_plist = "//content/app/ios/appex/${_process_target}.plist"
  }

  extension_bundle_data("${_process_target}_bundle") {
    forward_variables_from(invoker, TESTONLY_AND_VISIBILITY)
    extension_dir = "Extensions"
    extension_name = "${_process_target}.appex"
    extension_target = ":${_process_target}"
  }

  compile_entitlements("${_process_target}_entitlements") {
    substitutions = [ "IOS_BUNDLE_ID_PREFIX=$ios_app_bundle_id_prefix" ]
    output_name = "$target_gen_dir/${_process_target}.appex.entitlements"
    entitlements_templates =
        [ "//content/app/ios/appex/${_process_target}.appex.entitlements" ]
  }

  # We don't use ios_appex_bundle here because we don't want to mess with multiple
  # toolkits as the core framework is built with the default toolkit.
  ios_app_bundle(target_name) {
    forward_variables_from(invoker,
                           "*",
                           [
                             "defines",
                             "deps",
                             "framework_dirs",
                             "frameworks",
                             "public_deps",
                             "sources",
                             "target_name",
                           ])

    output_name = target_name
    transparent = true

    deps = [
      "//content/app/ios/appex:${_process_target}",
      "//content/shell:content_shell_framework+link",
    ]

    if (!defined(ldflags)) {
      ldflags = []
    }

    ldflags += [
      "-Wl,--ignore-auto-link-option=CoreAudioTypes",
      "-Wl,-no_application_extension",
      "-Wl,-rpath,@executable_path/../../Frameworks",
    ]

    product_type = "com.apple.product-type.app-extension"
    entitlements_target = ":${_process_target}_entitlements"
    info_plist_target = ":tweak_${_process_target}_plist"
  }
}

set_defaults("browserkit_extension") {
  configs = [ "//build/config/ios:ios_extension_executable_flags" ]
}