(compdb_file, files)
| 47 | |
| 48 | |
| 49 | def create_compile_commands(compdb_file, files): |
| 50 | compdb = [] |
| 51 | # TODO: bail out on empty list |
| 52 | for f in files: |
| 53 | compdb.append( |
| 54 | { |
| 55 | "file": str(f), |
| 56 | "directory": os.path.dirname(f), |
| 57 | "command": "gcc -c {}".format(os.path.basename(f)) |
| 58 | } |
| 59 | ) |
| 60 | compdb_j = json.dumps(compdb) |
| 61 | with open(compdb_file, 'wt') as f: |
| 62 | f.write(compdb_j) |
| 63 | |
| 64 | |
| 65 | def __lookup_cppcheck_exe(): |
no test coverage detected