summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/build/apple/apple_info_plist.gni
blob: fe51773dd001f3f6e2aad1ad8561562c3d02c306 (plain)
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
# Copyright 2021 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("//build/apple/compile_plist.gni")

# The base template used to generate Info.plist files for iOS and Mac apps and
# frameworks.
#
# Arguments
#
#     plist_templates:
#         string array, paths to plist files which will be used for the bundle.
#
#     executable_name:
#         string, name of the generated target used for the product
#         and executable name as specified in the output Info.plist.
#
#     format:
#         string, the format to `plutil -convert` the plist to when
#         generating the output.
#
#     extra_substitutions:
#         (optional) string array, 'key=value' pairs for extra fields which are
#         specified in a source Info.plist template.
#
#     output_name:
#         (optional) string, name of the generated plist file, default to
#         "$target_gen_dir/$target_name.plist".
template("apple_info_plist") {
  assert(defined(invoker.executable_name),
         "The executable_name must be specified for $target_name")
  executable_name = invoker.executable_name

  compile_plist(target_name) {
    forward_variables_from(invoker,
                           [
                             "plist_templates",
                             "testonly",
                             "deps",
                             "visibility",
                             "format",
                           ])

    if (defined(invoker.output_name)) {
      output_name = invoker.output_name
    } else {
      output_name = "$target_gen_dir/$target_name.plist"
    }

    substitutions = [
      "EXECUTABLE_NAME=$executable_name",
      "GCC_VERSION=com.apple.compilers.llvm.clang.1_0",
      "PRODUCT_NAME=$executable_name",
    ]
    if (defined(invoker.extra_substitutions)) {
      substitutions += invoker.extra_substitutions
    }
  }
}