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 Clang tools on Windows are still a bit busted. The tooling can't handle | |
8 backslashes in paths, doesn't understand how to read .rsp files, etc. In | |
9 addition, ninja generates compile commands prefixed with the ninja msvc helper, | |
Nico
2017/04/06 13:30:52
Only if you don't use is_clang these days. In clan
dcheng
2017/04/06 18:54:46
Oops, forgot to update this comment. Done.
| |
10 which also confuses clang. This script generates a compile DB that should mostly | |
11 work until clang tooling can be improved upstream. | |
12 """ | |
13 | |
14 import argparse | |
15 import os | |
16 import sys | |
17 | |
18 script_dir = os.path.dirname(os.path.realpath(__file__)) | |
19 tool_dir = os.path.abspath(os.path.join(script_dir, '../pylib')) | |
20 sys.path.insert(0, tool_dir) | |
21 | |
22 from clang import compile_db | |
23 | |
24 | |
25 def main(argv): | |
26 parser = argparse.ArgumentParser() | |
27 parser.add_argument( | |
28 'build_path', | |
29 nargs='?', | |
30 help='Path to build directory', | |
31 default='out/Debug') | |
32 args = parser.parse_args() | |
33 | |
34 compile_db.GenerateWithNinja(args.build_path) | |
35 | |
36 | |
37 if __name__ == '__main__': | |
38 sys.exit(main(sys.argv[1:])) | |
OLD | NEW |