From 5d8f9ab1ab484225fa64f6eb1704c6575f49dc18 Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Fri, 30 Oct 2020 16:47:11 +0100 Subject: [PATCH] Remove the 3rdParty commands. --- utilities/filterCompileCommands.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utilities/filterCompileCommands.py b/utilities/filterCompileCommands.py index e470826f6..3e8d1c1a7 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() -- GitLab