Skip to content

Instantly share code, notes, and snippets.

Avatar

Lee Runyon LeeRuns

  • Fort Collins Co
View GitHub Profile
@LeeRuns
LeeRuns / cc_merge.js
Created Feb 5, 2021 — forked from iauns/cc_merge.js
Merges multiple compilation databases (compile_commands.json -- output from CMake) into one. See this other gist for an example bash function that is responsible for compile_commands.json files and passing them into this script: https://gist.github.com/iauns/6276327.
View cc_merge.js
#!/usr/bin/env node
var fs = require('fs');
var argv = require('optimist')
.usage('Merge multiple clang compile_commands.json into one file.')
.demand('o')
.alias('o', 'output')
.describe('o', "Output merged compile_command.json file.")
.argv;
var commands = [];