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