Hi Adam, Is cmake running the capnp tool every time, or only when the capnp files change? I would suggest configuring it to only re-run the code generation when the .capnp files have changed. I don't personally know cmake but it surely supports this.
Unfortunately you are correct that there's no good way to forward-declare the nested types generated by the capnp tool. -Kenton On Fri, Jun 7, 2019 at 6:54 AM Ádám Balázs <[email protected]> wrote: > Hi all, > > I try to use Cap'NProto in a CMake based C++ project. CMake runs capnp > tool to generate headers/sources and adds them to the project. With this > approach I eliminate the inconsistent states, however the generated files > are touched every time CMake runs, so the compiler recompiles them during > the build. With forward declaration it wouldn't be a big deal, but as far > as I understand the generated code I can not forward declare builders and > readers since they are nested classes. This is a really unfortunate > situation, because the headers using the generated code are used in many > components (configurations). Can I somehow forward declare generated > classes? Could you advise some technique to solve the described situation? > Is it intended to prohibit forward declaration? > > Thank you in advance: Adam > > -- > You received this message because you are subscribed to the Google Groups > "Cap'n Proto" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > Visit this group at https://groups.google.com/group/capnproto. > To view this discussion on the web visit > https://groups.google.com/d/msgid/capnproto/d84ad038-22be-48c0-aac3-050fafc18ca1%40googlegroups.com > <https://groups.google.com/d/msgid/capnproto/d84ad038-22be-48c0-aac3-050fafc18ca1%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/capnproto. To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/CAJouXQ%3DSbRggayxzM1goybtb-%3D6LsEKMAoVeMJTDH-envvBw%3DQ%40mail.gmail.com.
