Index: build/common.gypi |
diff --git a/build/common.gypi b/build/common.gypi |
index 7f16b21c3f8e127873bde7c597bbd9524c1c3786..6044b5276044f314d6536c7861b052edb6dbdfe1 100644 |
--- a/build/common.gypi |
+++ b/build/common.gypi |
@@ -270,6 +270,15 @@ |
# won't be necessary. |
'clang%': 0, |
+ # These two variables can be set in GYP_DEFINES while running |
+ # |gclient runhooks| to let clang run a plugin in every compilation. |
+ # Only has an effect if 'clang=1' is in GYP_DEFINES as well. |
+ # Example: |
+ # GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_plugin=print-fns' gclient runhooks |
+ |
+ 'clang_load%': '', |
+ 'clang_add_plugin%': '', |
+ |
# Override whether we should use Breakpad on Linux. I.e. for Chrome bot. |
'linux_breakpad%': 0, |
# And if we want to dump symbols for Breakpad-enabled builds. |
@@ -1162,6 +1171,12 @@ |
'-mfpmath=sse', |
], |
}], |
+ ['clang==1 and clang_load!="" and clang_add_plugin!=""', { |
+ 'cflags': [ |
+ '-Xclang', '-load', '-Xclang', '<(clang_load)', |
+ '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', |
+ ], |
+ }], |
['no_strict_aliasing==1', { |
'cflags': [ |
'-fno-strict-aliasing', |
@@ -1274,6 +1289,12 @@ |
'-Wno-unnamed-type-template-args', |
], |
}], |
+ ['clang==1 and clang_load!="" and clang_add_plugin!=""', { |
+ 'OTHER_CFLAGS': [ |
+ '-Xclang', '-load', '-Xclang', '<(clang_load)', |
+ '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)', |
+ ], |
+ }], |
], |
}, |
'target_conditions': [ |