Last active
October 23, 2018 01:58
-
-
Save Junch/e80d98b7618a6cd023d17b36916d68f6 to your computer and use it in GitHub Desktop.
Script to generate the compile_commands.json
This file contains hidden or 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
| #!/bin/bash | |
| # Refer to | |
| # 1. http://blog.51cto.com/liveforlinux/689382 | |
| # 2. https://sarcasm.github.io/notes/dev/compilation-database.html | |
| # 3. https://unix.stackexchange.com/questions/38172/switching-to-zsh-are-all-bash-scripts-compatible-with-zsh/38173 | |
| # 在scons文件中,添加 env.Append(CCFLAGS=['-MJ', '${TARGET}.json']) | |
| find ./out/macosx-10.13-x86_64-rel/obj-static/src/ -name "*.o.json" | xargs sed -e '1s/^/[\'$'\n/' -e '$s/,$/\'$'\n]/' > compile_commands.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment