Hi Tim,
From the Advanced Options Dialog
Source ext: proto
Command:
'Compile single file to object file'
protoc-c --c_out=. $file_name.proto
Generated Files:
$file_dir/$file_name.pb-c.c
$file_dir/$file_name.pb-c.h
Note: I've tried it with and without the .h
Close project and reopen between changes to Advanced Options.
Looking closer at what C:B is doing when I edit the protocol file and build:
- Get to a clean build state where everything is update to date.
- Edit protocol file to change a member name which will cause a compile error from one of the project files that doesn't know the new name.
- Proto file compiles, generates .H and .C files. But the files that include the generated .H do not get compiled and linked.
- Hit build again, the files that include .H are compiled and in this case I get the error I induced.
Edit proto file again to fix error.
- Hit build.
- Proto file compiles, generates .H and .C files.
- C file that failed on previous build is also compiled in this case but none of the other .C files that include the generated .H file get compiled.
After build finishes "successfully"
- Hit build again.
- The other .C files that include the generated .H are compiled and linked.
Protocol source file Build priority weight at 20% so it should build ahead of the others, and generate the .H file (and .C) file before compiling others. I would expect that this would have the .H file available for the rest of the project to then scan. I'm thinking that perhaps C:B does the dependency scan before the build starts, and doesn't realize that the Protocol compile step is going to change things by generating new files that the rest of the project depend on. Could that be what is happening, since it seems to fit if you follow the steps above?
If so is there a way with in the project to regenerate the dependencies after the protocol compile step completes? And if so is there a good example of how to do that somewhere in the docs that I haven't seen?
Thanks,
Burt