Pipe compile_commands.json to Ceedling

32 views Asked by At

I'm trying to set up Ceedling in a way that, instead of hardcoding a bunch of include paths and defines in the project.yml file, I take them from the compile_commands.json file instead.

I haven't found a way of telling Ceedling to use it as an input, so instead I'm trying to get the defines and include paths myself, this is how I do it:

tr -s ' ' '\n' < .build/compile_commands.json | grep '^\-D' | sort -u | tr -s '\n' ' '

and for the include paths:

tr -s ' ' '\n' < .build/compile_commands.json | grep '^\-I' | sort -u | sed 's/-I..\/..\/..\/..\/src/-I../' | sed 's/\/\.$//' | tr -s '\n' ' '

If I run this, I get the following include path:

-I../rtos/FreeRTOS/Source/include

Which matches what I had set up in the project.yml:

- +:../rtos/FreeRTOS/Source/include

However, this doesn't seem to do the trick as I'm getting the following error:

ERROR: Found no file 'FreeRTOS.h' in search paths.

I tried to run a simple test by doing this, but it doesn't work either:

ceedling test:all "-I../rtos/FreeRTOS/Source/include"

Does anybody know what I'm doing wrong?

0

There are 0 answers