( filename, **kwargs )
| 132 | |
| 133 | |
| 134 | def FlagsForFile( filename, **kwargs ): |
| 135 | if database: |
| 136 | # Bear in mind that compilation_info.compiler_flags_ does NOT return a |
| 137 | # python list, but a "list-like" StringVec object |
| 138 | compilation_info = GetCompilationInfoForFile( filename ) |
| 139 | if not compilation_info: |
| 140 | return None |
| 141 | |
| 142 | final_flags = MakeRelativePathsInFlagsAbsolute( |
| 143 | compilation_info.compiler_flags_, |
| 144 | compilation_info.compiler_working_dir_ ) |
| 145 | |
| 146 | else: |
| 147 | relative_to = DirectoryOfThisScript() |
| 148 | final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) |
| 149 | |
| 150 | # Workaround for clang bug regarding default paths in compiling from |
| 151 | # libclang.so vs the clang binary |
| 152 | final_flags.extend([ |
| 153 | "-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/", |
| 154 | "-isystem/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/7.0.2/include" |
| 155 | ]) |
| 156 | |
| 157 | return { |
| 158 | 'flags': final_flags, |
| 159 | 'do_cache': True |
| 160 | } |
nothing calls this directly
no test coverage detected