summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-28 02:57:59 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-28 02:57:59 +0000
commit5e781237c0b817eb40e47831ae0e72c9d0b4c6b7 (patch)
treec53ab845a8f5afa1f664dd1fdf64144f94542657 /build
parent41366f41435ebcb88d24aa35528ae8ca8466914b (diff)
downloadchromium_src-5e781237c0b817eb40e47831ae0e72c9d0b4c6b7.zip
chromium_src-5e781237c0b817eb40e47831ae0e72c9d0b4c6b7.tar.gz
chromium_src-5e781237c0b817eb40e47831ae0e72c9d0b4c6b7.tar.bz2
clang: Make it possible to add a plugin through GYP_DEFINES
With this CL, one can run GYP_DEFINES='clang=1 clang_load=/Users/thakis/src/llvm-svn/tools/clang/examples/PrintFunctionNames/libPrintFunctionNames.dylib clang_plugin=print-fns' gclient runhooks and then the normal build will run with the clang example plugin. I'm not sure if this is the best way to run Elliot's plugin, but it's useful for local one-off runs. BUG=none TEST=none Review URL: http://codereview.chromium.org/6355010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72924 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/common.gypi21
1 files changed, 21 insertions, 0 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 7f16b21..6044b52 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': [