-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix compile_flags.txt to include correct paths
- Loading branch information
Showing
4 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Development | ||
|
||
## Clangd | ||
|
||
To get language support in VSCode and other IDEs we recommend using `clangd`-based language server. | ||
The server reads supplied `compile_flags.txt` file for correct options and include paths to resolve symbols | ||
in opened files. | ||
|
||
To support `clangd` project-level operations like `Find References` `compile_commands.json` file needs to | ||
be generated that will list all files in the project. If you do this, then it needs to be re-generated periodically | ||
when new files appear. | ||
|
||
1. Install `gen-compile-commands` | ||
|
||
```sh | ||
just prepare | ||
``` | ||
|
||
2. Generate `compile_commands.json` | ||
|
||
```sh | ||
just compile-commands | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
prepare: | ||
cargo install gen-compile-commands | ||
|
||
compile-commands: | ||
rm -f compile_commands.json | gen-compile-commands --root . --compile-flags compile_flags.txt --out compile_commands.json --src-dir ./src | ||
|
||
clean: | ||
rm -f compile_commands.json |