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

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

Issue 966723003: Rewrite plugin_flags.sh Bash script in Python. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: We are already in 2015. Ick. Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/scripts/plugin_flags.py
diff --git a/tools/clang/scripts/plugin_flags.py b/tools/clang/scripts/plugin_flags.py
new file mode 100644
index 0000000000000000000000000000000000000000..94fde566e61113e9bc85990f90b935ac87b26a8f
--- /dev/null
+++ b/tools/clang/scripts/plugin_flags.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# Copyright 2015 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.
+
+# This script returns the flags that should be used when GYP_DEFINES contains
+# clang_use_chrome_plugins. The flags are stored in a script so that they can
+# be changed on the bots without requiring a master restart.
+
+import os
+import sys
+
+# Path constants. (All of these should be absolute paths.)
+THIS_DIR = os.path.abspath(os.path.dirname(__file__))
+CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..'))
+CLANG_LIB_PATH = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build',
+ 'Release+Asserts', 'lib')
+
+if sys.platform == 'darwin':
+ LIBSUFFIX = 'dylib'
+else:
+ LIBSUFFIX = 'so'
+
+LIB_PATH = os.path.join(
+ CLANG_LIB_PATH,
+ 'libFindBadConstructs' +
+ '.' +
+ LIBSUFFIX)
+
+print '-Xclang -load -Xclang %s' \
+ ' -Xclang -add-plugin -Xclang find-bad-constructs' \
+ ' -Xclang -plugin-arg-find-bad-constructs' \
+ ' -Xclang check-weak-ptr-factory-order' \
+ ' -Xclang -plugin-arg-find-bad-constructs' \
+ ' -Xclang strict-virtual-specifiers' % LIB_PATH
Nico 2015/03/02 20:45:31 nit: i think the style guide suggests print ('asd
tfarina 2015/03/02 21:11:41 Done.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698