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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/config.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/BUILD.gn
diff --git a/third_party/WebKit/Source/BUILD.gn b/third_party/WebKit/Source/BUILD.gn
index 6ecca3e43d562ea0ea3ab442cef3b634150e2a46..cfc9a242330bc1109f3126987b46506b74383119 100644
--- a/third_party/WebKit/Source/BUILD.gn
+++ b/third_party/WebKit/Source/BUILD.gn
@@ -9,6 +9,23 @@ if (is_clang) {
visibility = [ "//third_party/WebKit/*" ]
+# arguments --------------------------------------------------------------------
+
+declare_args() {
+ # Set to true to enable the clang plugin that checks the usage of the Blink
+ # garbage-collection infrastructure during compilation.
+ blink_gc_plugin = true
+
+ # Set to true to have the clang Blink GC plugin emit class graph (in JSON)
+ # with typed pointer edges; for debugging or other (internal) uses.
+ blink_gc_plugin_option_do_dump_graph = false
+
+ # Set to true to have the clang Blink GC plugin additionally check if
+ # a class has an empty destructor which would be unnecessarily invoked
+ # when finalized.
+ blink_gc_plugin_option_warn_unneeded_finalizer = false
+}
+
# features ---------------------------------------------------------------------
config("features") {
@@ -54,32 +71,46 @@ config("config") {
}
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) {
+ # On Windows, the plugin is built directly into clang, so there's
+ # no need to load it dynamically.
+ if (!is_win) {
+ _blink_gc_plugin_dll_extension = "so"
+ if (is_mac || is_ios) {
+ _blink_gc_plugin_dll_extension = "dylib"
+ }
cflags += [
"-Xclang",
"-load",
"-Xclang",
rebase_path(
- "//third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so",
+ "${clang_base_path}/lib/libBlinkGCPlugin.${_blink_gc_plugin_dll_extension}",
root_build_dir),
]
}
-
cflags += [
"-Xclang",
"-add-plugin",
"-Xclang",
"blink-gc-plugin",
]
+
+ # Add arguments for enabled GC plugin options:
+ if (blink_gc_plugin_option_do_dump_graph) {
+ cflags += [
+ "-Xclang",
+ "-plugin-arg-blink-gc-plugin",
+ "-Xclang",
+ "dump-graph",
+ ]
+ }
+ if (blink_gc_plugin_option_warn_unneeded_finalizer) {
+ cflags += [
+ "-Xclang",
+ "-plugin-arg-blink-gc-plugin",
+ "-Xclang",
+ "warn-unneeded-finalizer",
+ ]
+ }
}
}
« 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