summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/Source/BUILD.gn
blob: 3ba696671a787fc6c88800d8ff729ff520f9d527 (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
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
# Copyright 2014 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("config.gni")
if (is_clang) {
  import("//build/config/clang/clang.gni")
}

visibility = [ "//third_party/WebKit/*" ]

# features ---------------------------------------------------------------------

config("features") {
  defines = feature_defines_list
}

# inside_blink -----------------------------------------------------------------

config("inside_blink") {
  defines = [
    "BLINK_IMPLEMENTATION=1",
    "INSIDE_BLINK",
  ]
}

# config -----------------------------------------------------------------------

config("config") {
  include_dirs = [
    ".",
    "..",
    "$root_gen_dir/blink",
    "$root_gen_dir/third_party/WebKit",
  ]

  cflags = []
  defines = []

  if (is_win) {
    cflags += [
      "/wd4305",  # Truncation from 'type1' to 'type2'.
      "/wd4324",  # Struct padded due to declspec(align).
      "/wd4714",  # Function marked forceinline not inlined.
      "/wd4800",  # Value forced to bool.
      "/wd4996",  # Deprecated function call.
    ]
  }

  if (is_win) {
    if (is_component_build) {
      defines += [ "USING_V8_SHARED" ]
    }
  }

  if (is_clang && blink_gc_plugin && clang_use_chrome_plugins) {
    if (is_mac || is_ios) {
      cflags += [
        "-Xclang",
        "-load",
        "-Xclang",
        rebase_path(
            "//third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.dylib",
            root_build_dir),
      ]
    } else if (is_linux) {
      cflags += [
        "-Xclang",
        "-load",
        "-Xclang",
        rebase_path(
            "//third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so",
            root_build_dir),
      ]
    }

    cflags += [
      "-Xclang",
      "-add-plugin",
      "-Xclang",
      "blink-gc-plugin",
    ]

    if (enable_oilpan) {
      cflags += [
        "-Xclang",
        "-plugin-arg-blink-gc-plugin",
        "-Xclang",
        "enable-oilpan",
      ]
    }
  }

  ## TODO(GYP) : gn does not yet support use_system_icu.
  #if (use_system_icu) {
  #  defines += [ "USING_SYSTEM_ICU" ]
  #}
}

# The follow configs apply to all targets except for unit tests, which rely on
# static initializers.
config("non_test_config") {
  cflags = []

  if (is_clang) {
    cflags += [ "-Wglobal-constructors" ]
  }
}

if (is_mac) {
  # This sets up precompiled headers for Mac.
  config("mac_precompiled_headers") {
    precompiled_header = rebase_path("build/mac/Prefix.h", root_build_dir)
    precompiled_source = "//third_party/WebKit/Source/build/mac/Prefix.h"
  }
}