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