Incremental build not working for header files

Hi there,

I am using cmake with “Ninja Multi-Config” generator on Linux with Green hills compiler. The incremental build is not working i.e. If I make changes in the header files, it would not show me any compilation error.
The clean build works fine after deleting the build directory. It also works fine with the clang compiler.
The .d and .dep files are generated in the build directory and it includes the expected header files.

Thanks and regards,
Prabhjot Singh

Can you share the build statements in build.ninja (though for NMC they might be build-$config.ninja) for the compilations of the objects that should be recompiling? Namely the depfile = and deps = bits. If deps = gcc is there, does ninja -t deps $object show the header?

Sorry for the late reply, I was on vacation.
It shows no result for depfile and deps in build-Release.ninja.

sip3wte@sip2wte-virtual-machine:~/cycursoc/build/awr294x-r5f-ghs$ grep -inrs "depfile" build-Release.ninja 
sip3wte@sip2wte-virtual-machine:~/cycursoc/build/awr294x-r5f-ghs$ grep -inrs "deps" build-Release.ninja 
sip3wte@sip2wte-virtual-machine:~/cycursoc/build/awr294x-r5f-ghs$
sip3wte@sip2wte-virtual-machine:~/cycursoc/build/awr294x-r5f-ghs$  ninja -t deps CycurSoC_Sample_She_HostMcu0.elf 
CycurSoC_Sample_She_HostMcu0.elf: deps not found
sip3wte@sip2wte-virtual-machine:~/cycursoc/build/awr294x-r5f-ghs$

Btw, I have also tried changing the generator to “Unix MakeFiles” and it still didn’t work!

The GHS compiler support in CMake looks very minimalistic. It doesn’t look like the compiler flag for dependency files is configured at all.
Can you check the content of the variable CMAKE_DEPFILE_FLAGS_C. If it’s empty, depfiles are currently not supported for GHS.
I haven’t found a GHS manual in the internet, so I can’t say, if the compiler supports it all all.