-
Notifications
You must be signed in to change notification settings - Fork 214
CDT fails to generate correct commands in compile_commands.json file #1130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Kummallinen / @alicetrifu can you have a look at this issue please? I can't reproduce exactly what @dc42 has, but on Linux, creating a C project with a cross-compile toolchain leads me to a compile commands.json with:
AFAICT if you don't have The error comes from an error introduced in #824 when full command lines were added. The assumption was that the ITool described the full toolname, but when using cross gcc, the IManagedCommandLineGenerator modifies the command by adding the prefix. i.e. ITool.getToolCommand returns The problem can be seen here: Lines 232 to 234 in 7420b12
|
Using Eclipse CDT 4.35.0 (build ID 20250306-0812) under Windows, cross compiling for ARM gcc. When the LSP editor is selected and logging is enabled, the output in the console window is as follows:
The errors appear to be because the compile_commands.json file does not contain the G++ or GCC command, just the prefix. Here is the start of compile_commands.json:
This is the tools setup I am using:
where ArmGccPath is a build variable containing the path to the version of gcc that this workspace uses, for example:
The .cproject file is available at https://github.com/Duet3D/RepRapFirmware/blob/3.6-dev/.cproject. The make utility in use is the one provided by MSYS2.
The text was updated successfully, but these errors were encountered: