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
In the utility CMake module tools/cmake/FindBpfObject.cmake, the step to compile BPF C source files to BPF object files is done by triggering clang with a custom command:
However, when I enable the CMAKE_EXPORT_COMPILE_COMMANDS option in my CMakeLists.txt, this step will not appear in compile_commands.json because it is a custom command. And because the C/C++ extension in VS Code relies on compile_commands.json for configurations like header locations, it cannot provide proper assistance to development in BPF C source files (*.bpf.c). Could this step be changed to make CMake manage this part so that it can generate correct compile commands? Or are there other ways to work around this issue?
Thanks in advance.
The text was updated successfully, but these errors were encountered:
I'm not familiar with CMake, so if you can investigate this and help with this, it would be great. If CMake supports some way to propagate such commands into compile_commands.json, that would be great.
In the utility CMake module tools/cmake/FindBpfObject.cmake, the step to compile BPF C source files to BPF object files is done by triggering clang with a custom command:
libbpf-bootstrap/tools/cmake/FindBpfObject.cmake
Lines 163 to 171 in be15d32
However, when I enable the
CMAKE_EXPORT_COMPILE_COMMANDS
option in myCMakeLists.txt
, this step will not appear incompile_commands.json
because it is a custom command. And because the C/C++ extension in VS Code relies oncompile_commands.json
for configurations like header locations, it cannot provide proper assistance to development in BPF C source files (*.bpf.c
). Could this step be changed to make CMake manage this part so that it can generate correct compile commands? Or are there other ways to work around this issue?Thanks in advance.
The text was updated successfully, but these errors were encountered: