feat: on-demand compile_commands.json generation#45
feat: on-demand compile_commands.json generation#45413x1nkp wants to merge 20 commits intotsoding:mainfrom
compile_commands.json generation#45Conversation
compile_commands.json generation
|
Clang is stingy about including POSIX extensions implicitly, so I couldn't figure out what the best option is, so i settled for declaring both explicitly. Let me know if this causes issues! |
|
Alternatively, you can use Bear together with nob for generating compile_commands.json |
|
+1 for Bear. No issues here with LSP and using what it generates. lol |
Yeah, |
|
This feature looks interesting, but I feel like it is too much outside of the scope of nob.h is trying to be, sorry. |
The goal was to add
compile_commands.jsongenerator into nob.Application: LSP
Windows testing is still required, works well on linux though
Example 1
produces:
[ { "directory": "/kirby/Coding/nobtest", "commands": "gcc -o main main.c", "file": "main.c" } ]Example 2
produces:
[ { "directory": "/kirby/Coding/nobtest", "commands": "gcc -o main main.c main1.c", "file": "main.c" }, { "directory": "/kirby/Coding/nobtest", "commands": "gcc -o main main.c main1.c", "file": "main1.c" } ]Example 3
produces
build/compile_commands.json:[ { "directory": "/kirby/Coding/nobtest", "command": "gcc -DSOME_VALUE=\"LOLO\" -o main main.c main1.c", "file": "main.c" }, { "directory": "/kirby/Coding/nobtest", "command": "gcc -DSOME_VALUE=\"LOLO\" -o main main.c main1.c", "file": "main1.c" } ]