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: http://src.chromium.org/svn/trunk/src/build@72924 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
thakis@chromium.org 2011-01-28 02:57:59 +00:00
Родитель ce459b8852
Коммит 84659a63de
1 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -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': [