Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated files include c.capnp.h but this header is not installed #22

Open
cquartier opened this issue Oct 3, 2017 · 2 comments
Open

Comments

@cquartier
Copy link

I see this included even in the file tests/addressbook.capnp.h

https://github.com/opensourcerouting/c-capnproto/blob/master/tests/addressbook.capnp.h#L10

#include "c.capnp.h"

This header file is not installed by make install

Why is this file included in the resulting schema header? If it is necessary shouldn't c.capnp.h be installed along with other headers?

@detly
Copy link
Collaborator

detly commented Oct 12, 2020

I encountered this problem too. It appears to be necessary if you use

using C = import "/capnp/c.capnp";
$C.fieldgetset;

I don't have a workaround but I'm looking into it.

@detly
Copy link
Collaborator

detly commented Jan 1, 2021

I "solved" this by adding an annotation that allows you to omit the include directive from generated files. For example, c.capnp has ID 0xc0183dd65ffef0f3. So in your schema file, you'd put:

using C = import "/capnp/c.capnp";

$C.donotinclude(0xc0183dd65ffef0f3);

The C files generated from this schema will not have #include "c.capnp.h" in them.

You can see this in my annotations branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants