OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 # This script returns the flags that should be used when GYP_DEFINES contains | 6 # This script returns the flags that should be used when GYP_DEFINES contains |
7 # clang_use_chrome_plugins. The flags are stored in a script so that they can | 7 # clang_use_chrome_plugins. The flags are stored in a script so that they can |
8 # be changed on the bots without requiring a master restart. | 8 # be changed on the bots without requiring a master restart. |
9 | 9 |
10 import os | 10 import os |
11 import sys | 11 import sys |
12 | 12 |
13 # Path constants. (All of these should be absolute paths.) | 13 # Path constants. (All of these should be absolute paths.) |
14 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) | 14 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) |
15 CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) | 15 CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) |
16 CLANG_LIB_PATH = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build', | 16 CLANG_LIB_PATH = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build', |
17 'Release+Asserts', 'lib') | 17 'Release+Asserts', 'lib') |
18 | 18 |
19 if sys.platform == 'darwin': | 19 if sys.platform == 'darwin': |
20 LIBSUFFIX = 'dylib' | 20 LIBSUFFIX = 'dylib' |
21 else: | 21 else: |
22 LIBSUFFIX = 'so' | 22 LIBSUFFIX = 'so' |
23 | 23 |
24 LIB_PATH = os.path.join( | 24 LIB_PATH = os.path.join( |
25 CLANG_LIB_PATH, | 25 CLANG_LIB_PATH, |
26 'libFindBadConstructs.' + LIBSUFFIX) | 26 'libFindBadConstructs.' + LIBSUFFIX) |
27 | 27 |
28 print ('-Xclang -load -Xclang %s' | 28 print ('-Xclang -load -Xclang %s' |
29 ' -Xclang -add-plugin -Xclang find-bad-constructs' | 29 ' -Xclang -add-plugin -Xclang find-bad-constructs') % LIB_PATH |
30 ' -Xclang -plugin-arg-find-bad-constructs' | |
31 ' -Xclang check-weak-ptr-factory-order' | |
32 ' -Xclang -plugin-arg-find-bad-constructs' | |
33 ' -Xclang strict-virtual-specifiers') % LIB_PATH | |
OLD | NEW |