cancel
Showing results for 
Search instead for 
Did you mean: 

CMake + CubeIDE indexing issue: Compilation Database Parser error

pmndt
Associate

 

Hi everyone,

I’ve successfully created and imported a CMake-based project for the STM32F777NIH in STM32CubeIDE 2.0.0. The project builds and compiles without any issues.

However, the IDE cannot properly resolve headers, some macros, variables, and some struct definitions. To fix this, I enabled:

set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)

in my top-level CMakeLists.txt, which correctly generates a compile_commands.json.

In CubeIDE, I also enabled C/C++ General → Preprocessor Include Paths, Macros etc. → Providers → Compilation Database Parser, and pointed it to the generated compile_commands.json (AN5952).

But CubeIDE shows:

Invalid build parser

And the error log contains:

“Compilation database parser does not have a build command parser configured.”

So it seems CubeIDE refuses to use the compilation database to resolve include paths, even though the file exists and is valid.

Is there any known workaround to allow STM32CubeIDE to consume compile_commands.json for indexing?
Or any other reliable way to fix header/struct auto-completion and indexing issues when working with CMake-based STM32 projects?

Thanks in advance!

 

Edit-1:

I have also attached the .ioc file in case it helps.

1 REPLY 1
Ghofrane GSOURI
ST Employee

Hello @pmndt 

I am currently checking this behavior. I will get back to you asap

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.