clang update script: add --extra-tools, deprecate --tools flag
plugins and blink_gc_plugin are always mandatory for Chromium builds, so just always include them. In order to avoid breaking codesearch bots, --tools is now a synonym for --extra-tools and will be removed. BUG=none Review-Url: https://codereview.chromium.org/2609683002 Cr-Commit-Position: refs/heads/master@{#441601}
This commit is contained in:
@ -97,16 +97,15 @@ Synopsis:
|
||||
|
||||
```shell
|
||||
tools/clang/scripts/update.py --bootstrap --force-local-build --without-android \
|
||||
--tools blink_gc_plugin plugins rewrite_to_chrome_style
|
||||
--extra-tools rewrite_to_chrome_style
|
||||
```
|
||||
|
||||
Running this command builds the [Oilpan plugin](https://chromium.googlesource.com/chromium/src/+/master/tools/clang/blink_gc_plugin/),
|
||||
the [Chrome style
|
||||
plugin](https://chromium.googlesource.com/chromium/src/+/master/tools/clang/plugins/),
|
||||
and the [Blink to Chrome style rewriter](https://chromium.googlesource.com/chromium/src/+/master/tools/clang/rewrite_to_chrome_style/). Additional arguments to `--tools` should be the name of
|
||||
and the [Blink to Chrome style rewriter](https://chromium.googlesource.com/chromium/src/+/master/tools/clang/rewrite_to_chrome_style/). Additional arguments to `--extra-tools` should be the name of
|
||||
subdirectories in
|
||||
[//tools/clang](https://chromium.googlesource.com/chromium/src/+/master/tools/clang).
|
||||
Generally, `--tools` should always include `blink_gc_plugin` and `plugins`: otherwise, Chromium won't build.
|
||||
|
||||
It is important to use --bootstrap as there appear to be [bugs](https://crbug.com/580745)
|
||||
in the clang library this script produces if you build it with gcc, which is the default.
|
||||
|
@ -633,6 +633,7 @@ def UpdateClang(args):
|
||||
cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args
|
||||
if cc is not None: cc_args.append('-DCMAKE_C_COMPILER=' + cc)
|
||||
if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
|
||||
chrome_tools = list(set(['plugins', 'blink_gc_plugin'] + args.extra_tools))
|
||||
cmake_args += base_cmake_args + [
|
||||
'-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
|
||||
'-DCMAKE_C_FLAGS=' + ' '.join(cflags),
|
||||
@ -645,7 +646,7 @@ def UpdateClang(args):
|
||||
# explicitly, https://crbug.com/622775
|
||||
'-DENABLE_LINKER_BUILD_ID=ON',
|
||||
'-DCHROMIUM_TOOLS_SRC=%s' % os.path.join(CHROMIUM_DIR, 'tools', 'clang'),
|
||||
'-DCHROMIUM_TOOLS=%s' % ';'.join(args.tools)]
|
||||
'-DCHROMIUM_TOOLS=%s' % ';'.join(chrome_tools)]
|
||||
|
||||
EnsureDirExists(LLVM_BUILD_DIR)
|
||||
os.chdir(LLVM_BUILD_DIR)
|
||||
@ -663,7 +664,7 @@ def UpdateClang(args):
|
||||
|
||||
RunCommand(['ninja'], msvc_arch='x64')
|
||||
|
||||
if args.tools:
|
||||
if chrome_tools:
|
||||
# If any Chromium tools were built, install those now.
|
||||
RunCommand(['ninja', 'cr-install'], msvc_arch='x64')
|
||||
|
||||
@ -846,9 +847,8 @@ def main():
|
||||
help='print current clang version (e.g. x.y.z) and exit.')
|
||||
parser.add_argument('--run-tests', action='store_true',
|
||||
help='run tests after building; only for local builds')
|
||||
parser.add_argument('--tools', nargs='*',
|
||||
help='select which chrome tools to build',
|
||||
default=['plugins', 'blink_gc_plugin'])
|
||||
parser.add_argument('--extra-tools', '--tools', nargs='*',
|
||||
help='select additional chrome tools to build')
|
||||
parser.add_argument('--without-android', action='store_false',
|
||||
help='don\'t build Android ASan runtime (linux only)',
|
||||
dest='with_android',
|
||||
|
Reference in New Issue
Block a user