• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2019 The Chromium Authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5config("compiler") {
6  configs = [
7    ":include_dirs",
8    ":cpp_standard",
9    ":objc_use_arc",
10    ":objc_abi_version",
11  ]
12}
13
14config("shared_binary") {
15  if (current_os == "ios" || current_os == "mac") {
16    configs = [ ":rpath_config" ]
17  }
18}
19
20config("objc_abi_version") {
21  cflags_objc = [ "-fobjc-abi-version=2" ]
22  cflags_objcc = cflags_objc
23  ldflags = [
24    "-Xlinker",
25    "-objc_abi_version",
26    "-Xlinker",
27    "2",
28  ]
29}
30
31config("include_dirs") {
32  include_dirs = [
33    "//",
34    root_out_dir,
35  ]
36}
37
38config("objc_use_arc") {
39  cflags_objc = [
40    "-fobjc-arc",
41    "-fobjc-weak",
42  ]
43  cflags_objcc = cflags_objc
44}
45
46config("cpp_standard") {
47  cflags_c = [ "--std=c11" ]
48  cflags_cc = [
49    "--std=c++17",
50    "--stdlib=libc++",
51  ]
52  ldflags = [ "--stdlib=libc++" ]
53}
54
55if (current_os == "ios" || current_os == "mac") {
56  config("rpath_config") {
57    ldflags = [
58      "-Xlinker",
59      "-rpath",
60      "-Xlinker",
61      "@executable_path/Frameworks",
62      "-Xlinker",
63      "-rpath",
64      "-Xlinker",
65      "@loader_path/Frameworks",
66    ]
67  }
68}
69