You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PlatformIO Core.
If you’ve found a bug, please provide an information below.
Configuration
Operating system:
mac os 13.5.2
PlatformIO Version (platformio --version):
PlatformIO Core, 6.1.11
Description of problem
Following instructions from here
If you set COMPILATIONDB_INCLUDE_TOOLCHAIN and run pio run -t compiledb, you generate compile_commands.json toolchains are included with files in src but any private libraries compiled from the lib directory do not have the toolchains included.
This causes a bit of a headache using clangd in neovim as the LSP gives errors for system libraries included in private libraries. One solution is to manually include toolchain paths in library.json build flags, but I imagine the expected behavior of the COMPILATIONDB_INCLUDE_TOOLCHAIN flag should be to include the toolchains for all files compiled in the project
Steps to Reproduce
Following instructions from here and set include toolchains to true
pio run -t compildedb
inspect generated compile_commands.json and observe that libraries in the lib directory dont include toolchains in their compiler commands
Actual Results
toolchains not included in private library build command
impact: clangd LSP in neovim can't find c standard libraries when viewing private library files
Expected Results
toolchains included in private library build command
clangd properly resolved standard libraries included in private library source files
…ns to compiledb include paths and added a call to it in the library building step for user defined libraries, allowing the automatic inclusion of toolchains in private lib compiledb generation
pvbaudin
added a commit
to pvbaudin/platformio-core
that referenced
this issue
Oct 20, 2023
…ns to compiledb include paths and added a call to it in the library building step for user defined libraries, allowing the automatic inclusion of toolchains in private lib compiledb generation
Issue #4762 separated out the optional addition of toolchains to compiledb include paths and added a call to it in the library building step for user defined libraries, allowing the automatic inclusion of toolchains in private lib compiledb generation
If you’ve found a bug, please provide an information below.
Configuration
Operating system:
mac os 13.5.2
PlatformIO Version (
platformio --version
):PlatformIO Core, 6.1.11
Description of problem
Following instructions from here
If you set
COMPILATIONDB_INCLUDE_TOOLCHAIN
and runpio run -t compiledb
, you generatecompile_commands.json
toolchains are included with files in src but any private libraries compiled from the lib directory do not have the toolchains included.This causes a bit of a headache using clangd in neovim as the LSP gives errors for system libraries included in private libraries. One solution is to manually include toolchain paths in library.json build flags, but I imagine the expected behavior of the
COMPILATIONDB_INCLUDE_TOOLCHAIN
flag should be to include the toolchains for all files compiled in the projectSteps to Reproduce
pio run -t compildedb
Actual Results
toolchains not included in private library build command
impact: clangd LSP in neovim can't find c standard libraries when viewing private library files
Expected Results
toolchains included in private library build command
clangd properly resolved standard libraries included in private library source files
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file to reproduce issue:
minimal project demonstrating issue here
compile_commands.json
The text was updated successfully, but these errors were encountered: