Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/WebKit/Source/BUILD.gn

Issue 2097433002: gn: add Blink GC plugin options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add TODO Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/config.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("config.gni") 5 import("config.gni")
6 if (is_clang) { 6 if (is_clang) {
7 import("//build/config/clang/clang.gni") 7 import("//build/config/clang/clang.gni")
8 } 8 }
9 9
10 visibility = [ "//third_party/WebKit/*" ] 10 visibility = [ "//third_party/WebKit/*" ]
11 11
12 # arguments --------------------------------------------------------------------
13
14 declare_args() {
15 # Set to true to enable the clang plugin that checks the usage of the Blink
16 # garbage-collection infrastructure during compilation.
17 blink_gc_plugin = true
18
19 # Set to true to have the clang Blink GC plugin emit class graph (in JSON)
20 # with typed pointer edges; for debugging or other (internal) uses.
21 blink_gc_plugin_option_do_dump_graph = false
22
23 # Set to true to have the clang Blink GC plugin additionally check if
24 # a class has an empty destructor which would be unnecessarily invoked
25 # when finalized.
26 blink_gc_plugin_option_warn_unneeded_finalizer = false
27 }
28
12 # features --------------------------------------------------------------------- 29 # features ---------------------------------------------------------------------
13 30
14 config("features") { 31 config("features") {
15 defines = feature_defines_list 32 defines = feature_defines_list
16 } 33 }
17 34
18 # inside_blink ----------------------------------------------------------------- 35 # inside_blink -----------------------------------------------------------------
19 36
20 config("inside_blink") { 37 config("inside_blink") {
21 defines = [ 38 defines = [
(...skipping 25 matching lines...) Expand all
47 ] 64 ]
48 } 65 }
49 66
50 if (is_win) { 67 if (is_win) {
51 if (is_component_build) { 68 if (is_component_build) {
52 defines += [ "USING_V8_SHARED" ] 69 defines += [ "USING_V8_SHARED" ]
53 } 70 }
54 } 71 }
55 72
56 if (is_clang && blink_gc_plugin && clang_use_chrome_plugins) { 73 if (is_clang && blink_gc_plugin && clang_use_chrome_plugins) {
57 if (is_mac || is_ios) { 74 # On Windows, the plugin is built directly into clang, so there's
75 # no need to load it dynamically.
76 if (!is_win) {
77 _blink_gc_plugin_dll_extension = "so"
78 if (is_mac || is_ios) {
79 _blink_gc_plugin_dll_extension = "dylib"
80 }
58 cflags += [ 81 cflags += [
59 "-Xclang", 82 "-Xclang",
60 "-load", 83 "-load",
61 "-Xclang", 84 "-Xclang",
62 rebase_path( 85 rebase_path(
63 "//third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.dylib ", 86 "${clang_base_path}/lib/libBlinkGCPlugin.${_blink_gc_plugin_dll_exte nsion}",
64 root_build_dir),
65 ]
66 } else if (is_linux) {
67 cflags += [
68 "-Xclang",
69 "-load",
70 "-Xclang",
71 rebase_path(
72 "//third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so",
73 root_build_dir), 87 root_build_dir),
74 ] 88 ]
75 } 89 }
76
77 cflags += [ 90 cflags += [
78 "-Xclang", 91 "-Xclang",
79 "-add-plugin", 92 "-add-plugin",
80 "-Xclang", 93 "-Xclang",
81 "blink-gc-plugin", 94 "blink-gc-plugin",
82 ] 95 ]
96
97 # Add arguments for enabled GC plugin options:
98 if (blink_gc_plugin_option_do_dump_graph) {
99 cflags += [
100 "-Xclang",
101 "-plugin-arg-blink-gc-plugin",
102 "-Xclang",
103 "dump-graph",
104 ]
105 }
106 if (blink_gc_plugin_option_warn_unneeded_finalizer) {
107 cflags += [
108 "-Xclang",
109 "-plugin-arg-blink-gc-plugin",
110 "-Xclang",
111 "warn-unneeded-finalizer",
112 ]
113 }
83 } 114 }
84 } 115 }
85 116
86 # The follow configs apply to all targets except for unit tests, which rely on 117 # The follow configs apply to all targets except for unit tests, which rely on
87 # static initializers. 118 # static initializers.
88 config("non_test_config") { 119 config("non_test_config") {
89 cflags = [] 120 cflags = []
90 121
91 if (is_clang) { 122 if (is_clang) {
92 cflags += [ "-Wglobal-constructors" ] 123 cflags += [ "-Wglobal-constructors" ]
93 } 124 }
94 } 125 }
95 126
96 if (is_mac) { 127 if (is_mac) {
97 # This sets up precompiled headers for Mac. 128 # This sets up precompiled headers for Mac.
98 config("mac_precompiled_headers") { 129 config("mac_precompiled_headers") {
99 precompiled_header = rebase_path("build/mac/Prefix.h", root_build_dir) 130 precompiled_header = rebase_path("build/mac/Prefix.h", root_build_dir)
100 precompiled_source = "//third_party/WebKit/Source/build/mac/Prefix.h" 131 precompiled_source = "//third_party/WebKit/Source/build/mac/Prefix.h"
101 } 132 }
102 } 133 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/config.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698