diff --git a/utilities/filterCompileCommands.py b/utilities/filterCompileCommands.py index e470826f65f2fa16db52d0437446b8a56ee62a48..3e8d1c1a766717acc28b15bc627b888da2f7e201 100644 --- a/utilities/filterCompileCommands.py +++ b/utilities/filterCompileCommands.py @@ -3,6 +3,8 @@ import json import sys +def compileCommandSelector(x): + return not (("3rdParty" in x["file"])) if __name__ == "__main__": if len(sys.argv) != 2: @@ -16,4 +18,12 @@ if __name__ == "__main__": cc = json.load(fin) fin.close() - print("compile commands read: {}".format(len(cc))) \ No newline at end of file + print("compile commands read: {}".format(len(cc))) + + cc_filtered = list(filter(compileCommandSelector, cc)) + + print("compile commands filtered: {}".format(len(cc_filtered))) + + fout = open(filename, "w") + json.dump(cc_filtered, fout, indent=4) + fout.close()