( filename )
| 139 | |
| 140 | |
| 141 | def GetCompilationInfoForFile( filename ): |
| 142 | # The compilation_commands.json file generated by CMake does not have entries |
| 143 | # for header files. So we do our best by asking the db for flags for a |
| 144 | # corresponding source file, if any. If one exists, the flags for that file |
| 145 | # should be good enough. |
| 146 | if IsHeaderFile( filename ): |
| 147 | basename = os.path.splitext( filename )[ 0 ] |
| 148 | for extension in SOURCE_EXTENSIONS: |
| 149 | replacement_file = basename + extension |
| 150 | if os.path.exists( replacement_file ): |
| 151 | compilation_info = database.GetCompilationInfoForFile( |
| 152 | replacement_file ) |
| 153 | if compilation_info.compiler_flags_: |
| 154 | return compilation_info |
| 155 | return None |
| 156 | return database.GetCompilationInfoForFile( filename ) |
| 157 | |
| 158 | |
| 159 | def FlagsForFile( filename, **kwargs ): |
no test coverage detected
searching dependent graphs…