figure out how to run this from the command line
This commit is contained in:
parent
c76afd0200
commit
6b6a591afe
2 changed files with 8 additions and 3 deletions
8
Makefile
8
Makefile
|
@ -1,4 +1,5 @@
|
|||
CXX=clang++ -std=c++11 -stdlib=libc++ `pkg-config capnp --cflags --libs`
|
||||
CXX=clang++
|
||||
CXX_FLAGS=-std=c++11 -stdlib=libc++ `pkg-config capnp --cflags --libs`
|
||||
|
||||
CAPNPC_JAVA_SOURCES=generator/src/main/cpp/compiler/capnpc-java.c++
|
||||
|
||||
|
@ -11,9 +12,10 @@ clean :
|
|||
sbt clean
|
||||
|
||||
capnpc-java : $(CAPNPC_JAVA_SOURCES)
|
||||
$(CXX) -I/usr/local/include -g $(CAPNPC_JAVA_SOURCES) -o capnpc-java
|
||||
$(CXX) $(CXX_FLAGS) -g $(CAPNPC_JAVA_SOURCES) -o capnpc-java
|
||||
|
||||
addressbook : capnpc-java
|
||||
PWD=pwd
|
||||
mkdir examples/src/main/generated
|
||||
capnp compile -I$(PWD)/generator/src/main/cpp/compiler --src-prefix=examples/src/main/schema -o./capnpc-java:examples/src/main/generated examples/src/main/schema/addressbook.capnp
|
||||
sbt examples/"run read"
|
||||
# sbt examples/"run read"
|
||||
|
|
|
@ -10,3 +10,6 @@ When you first build the project, try running `sbt update gen-idea`. This will b
|
|||
|
||||
When running `make`, the supporting Java code will be built, and the sample schema will be run through the code generator as well to produce the Java binding. You can find the generated code in `/examples/src/main/generated/Addressbook.java`
|
||||
|
||||
```
|
||||
echo '(people = [(id = 123, name = "Alice", email = "alice@example.com", employment = (school = "MIT"))])' | capnp encode examples/src/main/schema/addressbook.capnp AddressBook | java -cp generator/target/scala-2.11/classes:examples/target/scala-2.11/classes/ org.capnproto.examples.AddressbookMain read
|
||||
```
|
Loading…
Reference in a new issue