OLD | NEW |
1 # Copyright 2015 the V8 project authors. All rights reserved. | 1 # Copyright 2015 the V8 project authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # Autocompletion config for YouCompleteMe in V8. | 5 # Autocompletion config for YouCompleteMe in V8. |
6 # | 6 # |
7 # USAGE: | 7 # USAGE: |
8 # | 8 # |
9 # 1. Install YCM [https://github.com/Valloric/YouCompleteMe] | 9 # 1. Install YCM [https://github.com/Valloric/YouCompleteMe] |
10 # (Googlers should check out [go/ycm]) | 10 # (Googlers should check out [go/ycm]) |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 import os | 40 import os |
41 import os.path | 41 import os.path |
42 import subprocess | 42 import subprocess |
43 import sys | 43 import sys |
44 | 44 |
45 | 45 |
46 # Flags from YCM's default config. | 46 # Flags from YCM's default config. |
47 flags = [ | 47 flags = [ |
48 '-DUSE_CLANG_COMPLETER', | 48 '-DUSE_CLANG_COMPLETER', |
49 '-std=c++11', | 49 '-std=gnu++0x', |
50 '-x', | 50 '-x', |
51 'c++', | 51 'c++', |
52 ] | 52 ] |
53 | 53 |
54 | 54 |
55 def PathExists(*args): | 55 def PathExists(*args): |
56 return os.path.exists(os.path.join(*args)) | 56 return os.path.exists(os.path.join(*args)) |
57 | 57 |
58 | 58 |
59 def FindV8SrcFromFilename(filename): | 59 def FindV8SrcFromFilename(filename): |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 'flags': (List of Strings) Command line flags. | 188 'flags': (List of Strings) Command line flags. |
189 'do_cache': (Boolean) True if the result should be cached. | 189 'do_cache': (Boolean) True if the result should be cached. |
190 """ | 190 """ |
191 v8_root = FindV8SrcFromFilename(filename) | 191 v8_root = FindV8SrcFromFilename(filename) |
192 v8_flags = GetClangCommandFromNinjaForFilename(v8_root, filename) | 192 v8_flags = GetClangCommandFromNinjaForFilename(v8_root, filename) |
193 final_flags = flags + v8_flags | 193 final_flags = flags + v8_flags |
194 return { | 194 return { |
195 'flags': final_flags, | 195 'flags': final_flags, |
196 'do_cache': True | 196 'do_cache': True |
197 } | 197 } |
OLD | NEW |