[cmake-developers] How to handle dependencies of protobuf files ?
Alexander Neundorf
neundorf at kde.org
Fri May 25 15:42:06 EDT 2018
Any comments ?
Alex
On 2018 M05 15, Tue 21:45:06 CEST Alexander Neundorf wrote:
> Hi,
>
> I stumbled upon a problem with protobuf files, I attached a testcase.
> There is a MyBase.proto, which is "imported" by Complex.proto.
> If MyBase.proto is modified, protoc is run again in MyBase.proto, but not on
> Complex.proto, although it should.
> You can have a look at the attached example.
>
> The message MyData (in Complex.proto) has a member MyBase b1.
> If I rename the message MyBase (in MyBase.proto) e.g. to MyBaseXYZ, then the
> build fails, because Complex.pb.h was not regenerated, so it still refered
> to the now not existing class MyBase.
>
> Is there already a solution to handle this ?
>
> I think to do it properly, there would have to be a dependency scanning for
> proto files like there is for C/C++ headers.
> Parsing at the proto-files at cmake time wouldn't be good enough (since
> editing a proto file doesn't trigger a cmake run).
>
> Comments ?
>
> Alex
More information about the cmake-developers
mailing list