( filename )
| 114 | |
| 115 | |
| 116 | def GetCompilationInfoForFile( filename ): |
| 117 | # The compilation_commands.json file generated by CMake does not have entries |
| 118 | # for header files. So we do our best by asking the db for flags for a |
| 119 | # corresponding source file, if any. If one exists, the flags for that file |
| 120 | # should be good enough. |
| 121 | if IsHeaderFile( filename ): |
| 122 | basename = os.path.splitext( filename )[ 0 ] |
| 123 | for extension in SOURCE_EXTENSIONS: |
| 124 | replacement_file = basename + extension |
| 125 | if os.path.exists( replacement_file ): |
| 126 | compilation_info = database.GetCompilationInfoForFile( |
| 127 | replacement_file ) |
| 128 | if compilation_info.compiler_flags_: |
| 129 | return compilation_info |
| 130 | return None |
| 131 | return database.GetCompilationInfoForFile( filename ) |
| 132 | |
| 133 | |
| 134 | def FlagsForFile( filename, **kwargs ): |
no test coverage detected