Add all .capnp files to make dist archive.

This commit is contained in:
Alex Helfet 2017-03-26 15:23:35 +01:00
parent 5a282f6c98
commit 6b52d615a2
3 changed files with 18 additions and 0 deletions

View file

@ -44,6 +44,11 @@ noinst_HEADERS += \
compiler/schema.capnp.h \
compiler/c++.capnp.h
# Don't try to generate any *.capnp files. Otherwise make wants to compile them
# from *.capnp.c and fails.
%.capnp: ;
# googletest
GTEST_LDADD = gtest/googletest/lib/libgtest.la
gtest/googletest/lib/libgtest.la:
make -C gtest/googletest lib/libgtest.la
@ -65,6 +70,10 @@ noinst_HEADERS += \
compiler/test.capnp.h \
tests/example.capnp.h
EXTRA_DIST += \
compiler/c.capnp \
compiler/c++.capnp \
compiler/schema.capnp \
compiler/test.capnp \
tests/example.capnp
capn_test_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_CPPFLAGS)
capn_test_CXXFLAGS = -std=gnu++11 -pthread

View file

@ -68,6 +68,11 @@ You need to compile these runtime library files and link them into your own proj
Your include path must contain the runtime library directory [`lib`](lib). Header file [`lib/capnp_c.h`](lib/capnp_c.h) contains the public interfaces of the library.
Using make-based builds, make may try to compile `${x}.capnp` from
`${x}.capnp.c` using its built-in rule for compiling `${y}` from
`${y}.c`. You can either disable make's built-in compile rules or just
this specific case with the no-op rule: `%.capnp: ;`.
For further reference, please see the other unit tests in [`tests`](tests), and header file [`lib/capnp_c.h`](lib/capnp_c.h).
The project [`quagga-capnproto`](https://github.com/opensourcerouting/quagga-capnproto) uses `c-capnproto` and contains some good examples, as found with [this github repository search](https://github.com/opensourcerouting/quagga-capnproto/search?utf8=%E2%9C%93&q=capn&type=):

View file

@ -29,6 +29,10 @@ annotation nameinfix @0x85a8d86d736ba637 (file): Text;
# to a loop. $nameinfix (recommended parameter: "-gen") inserts its parameter
# before the ".c", so the filename becomes "foo-gen.c"
#
# Alternatively, add this Makefile rule to disable compiling "foo.capnp.c" -> "foo.capnp":
# %.capnp: ;
#
#
# ("foo" is really "foo.capnp", so it's foo.capnp-gen.c)
annotation fieldgetset @0xf72bc690355d66de (file): Void;