Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(660)

Unified Diff: tools/clang/scripts/generate_compdb.py

Issue 2798233002: Share logic for generating compile DB with run_tool.py (Closed)
Patch Set: thakis comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/clang/pylib/clang/compile_db.py ('k') | tools/clang/scripts/generate_win_compdb.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/scripts/generate_compdb.py
diff --git a/tools/clang/scripts/generate_compdb.py b/tools/clang/scripts/generate_compdb.py
new file mode 100755
index 0000000000000000000000000000000000000000..a33e40955452cbe75a780690afb1ca25eae2f481
--- /dev/null
+++ b/tools/clang/scripts/generate_compdb.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Helper for generating compile DBs for clang tooling. On non-Windows platforms,
+this is pretty straightforward. On Windows, the tool does a bit of extra work to
+integrate the content of response files, force clang tooling to run in clang-cl
+mode, etc.
+"""
+
+import argparse
+import os
+import sys
+
+script_dir = os.path.dirname(os.path.realpath(__file__))
+tool_dir = os.path.abspath(os.path.join(script_dir, '../pylib'))
+sys.path.insert(0, tool_dir)
+
+from clang import compile_db
+
+
+def main(argv):
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ 'build_path',
+ nargs='?',
+ help='Path to build directory',
+ default='out/Debug')
+ args = parser.parse_args()
+
+ compile_db.GenerateWithNinja(args.build_path)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
« no previous file with comments | « tools/clang/pylib/clang/compile_db.py ('k') | tools/clang/scripts/generate_win_compdb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698