1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/dist/tools/compile_commands/README.md
Marian Buschsieweke a07dac9ad1
build system: add new compile-commands make target
By running make compile-commands a `compile_commands.json` in the RIOT base
directory. With the environment variable `COMPILE_COMMANDS` the path of
this file can be changed to a custom location.

The `compile_commands.json` will contain the exact compile command, but
as additional flag `-I/usr/$(TARGET)/include` is added to work around
`clangd` not being able to locate the newlib system headers. The
additional includes can be overwritten using the environment variable
`COMPILE_COMMANDS_EXTRA_INCLUDES`.
2021-04-14 14:51:46 +02:00

520 B

Generation of compile_commands.json

This tool can be used to generate compile_commands.json e.g. for code completion and linting in IDEs. It relies on the build system providing the compilation details in bin dir. This tools is best invoked indirectly via make compile-commands inside the application, which will first generate the required files in the bin directory and then invoke this tool. For more details, check the getting started page in the RIOT API documentation.