OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 """ |
| 7 Helper for generating compile DBs for clang tooling. On non-Windows platforms, |
| 8 this is pretty straightforward. On Windows, the tool does a bit of extra work to |
| 9 integrate the content of response files, force clang tooling to run in clang-cl |
| 10 mode, etc. |
| 11 """ |
| 12 |
| 13 import argparse |
| 14 import os |
| 15 import sys |
| 16 |
| 17 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 18 tool_dir = os.path.abspath(os.path.join(script_dir, '../pylib')) |
| 19 sys.path.insert(0, tool_dir) |
| 20 |
| 21 from clang import compile_db |
| 22 |
| 23 |
| 24 def main(argv): |
| 25 parser = argparse.ArgumentParser() |
| 26 parser.add_argument( |
| 27 'build_path', |
| 28 nargs='?', |
| 29 help='Path to build directory', |
| 30 default='out/Debug') |
| 31 args = parser.parse_args() |
| 32 |
| 33 compile_db.GenerateWithNinja(args.build_path) |
| 34 |
| 35 |
| 36 if __name__ == '__main__': |
| 37 sys.exit(main(sys.argv[1:])) |
OLD | NEW |