Created
December 13, 2016 04:48
-
-
Save karkhaz/2ab5e8c7a8783318d44ceca715f20438 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import json | |
import os.path | |
import re | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--clang-path", required=True) | |
args = parser.parse_args() | |
clang_path = os.path.abspath(args.clang_path) | |
with open("compile_commands.json") as f: | |
data = json.load(f) | |
for entry in data: | |
entry["command"] = re.sub("^cc", clang_path, entry["command"]) | |
print(json.dumps(data, f, indent=2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment