Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
capnproto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
capnproto
Commits
83d30c2f
Commit
83d30c2f
authored
Jun 24, 2013
by
Kenton Varda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve makefiles to the point that make distcheck works.
parent
ea54158d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
52 additions
and
34 deletions
+52
-34
LICENSE.txt
c++/LICENSE.txt
+2
-0
Makefile.am
c++/Makefile.am
+14
-24
README.txt
c++/README.txt
+14
-0
encoding-test.c++
c++/src/capnp/encoding-test.c++
+1
-1
schema.h
c++/src/capnp/schema.h
+1
-1
serialize-packed-test.c++
c++/src/capnp/serialize-packed-test.c++
+0
-1
serialize-test.c++
c++/src/capnp/serialize-test.c++
+0
-1
test-util.h
c++/src/capnp/test-util.h
+1
-1
Main.hs
compiler/src/Main.hs
+19
-5
No files found.
c++/LICENSE.txt
0 → 120000
View file @
83d30c2f
../LICENSE
\ No newline at end of file
c++/Makefile.am
View file @
83d30c2f
...
...
@@ -4,15 +4,11 @@ ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS
=
foreign
AM_CXXFLAGS
=
-I
$(srcdir)
/src
AM_CXXFLAGS
=
-I
$(srcdir)
/src
-I
$(builddir)
/src
EXTRA_DIST
=
\
README.txt
\
INSTALL.txt
\
COPYING.txt
\
CONTRIBUTORS.txt
\
CHANGES.txt
\
$(capnpc_inputs)
\
LICENSE.txt
\
$(test_capnpc_inputs)
CLEANFILES
=
$(capnpc_outputs)
$(test_capnpc_outputs)
capnpc_middleman test_capnpc_middleman
...
...
@@ -46,31 +42,31 @@ maintainer-clean-local:
# unexpectedly overwritten! We need to cancel the implicit rule by declaring an explicit one.
#
# I want the hours of my life back that I spent figuring this out.
$(capnpc_inputs) $(test_capnpc_inputs)
:
:
%.capnp
:
@
:
capnpc_inputs
=
\
# Implicit rules for invoking capnpc.
%.capnp.h
:
%.capnp
$(CAPNPC)
--src-prefix
=
$(srcdir)
-oc
++
$^
%.capnp.c++
:
%.capnp.h
@
:
public_capnpc_inputs
=
\
src/capnp/c++.capnp
\
src/capnp/schema.capnp
capnpc_inputs
=
$(public_capnpc_inputs)
capnpc_outputs
=
\
src/capnp/c++.capnp.c++
\
src/capnp/c++.capnp.h
\
src/capnp/schema.capnp.c++
\
src/capnp/schema.capnp.h
capnpc_middleman
:
$(capnpc_inputs)
$(CAPNPC)
-oc
++
$(capnpc_inputs)
touch
capnpc_middleman
$(capnpc_outputs)
:
capnpc_middleman
includecapnpdir
=
$(includedir)
/capnp
includekjdir
=
$(includedir)
/kj
dist_includecapnp_DATA
=
\
src/capnp/c++.capnp
\
src/capnp/schema.capnp
dist_includecapnp_DATA
=
$(public_capnpc_inputs)
includekj_HEADERS
=
\
src/kj/common.h
\
...
...
@@ -148,12 +144,6 @@ test_capnpc_outputs = \
src/capnp/test-import.capnp.c++
\
src/capnp/test-import.capnp.h
test_capnpc_middleman
:
$(test_capnpc_inputs)
$(CAPNPC)
-oc
++
$(test_capnpc_inputs)
touch
test_capnpc_middleman
$(test_capnpc_outputs)
:
test_capnpc_middleman
BUILT_SOURCES
=
$(test_capnpc_outputs)
$(capnpc_outputs)
check_PROGRAMS
=
capnp-test
...
...
c++/README.txt
0 → 100644
View file @
83d30c2f
Cap'n Proto - Insanely Fast Data Serialization Format
Copyright 2013 Kenton Varda
http://kentonv.github.com/capnproto/
This package contains the C++ runtime implementation of Cap'n Proto.
Cap'n Proto is an insanely fast data interchange format and capability-based
RPC system. Think JSON, except binary. Or think of Google's Protocol Buffers
(http://protobuf.googlecode.com), except faster. In fact, in benchmarks,
Cap'n Proto is INFINITY TIMES faster than Protocol Buffers.
Full installation instructions and other documentation are maintained on the
Cap'n Proto web site:
http://kentonv.github.io/capnproto/install.html
c++/src/capnp/encoding-test.c++
View file @
83d30c2f
...
...
@@ -21,7 +21,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include
"test-import.capnp.h"
#include
<capnp/test-import.capnp.h>
#include "message.h"
#include <kj/debug.h>
#include <gtest/gtest.h>
...
...
c++/src/capnp/schema.h
View file @
83d30c2f
...
...
@@ -24,7 +24,7 @@
#ifndef CAPNP_SCHEMA_H_
#define CAPNP_SCHEMA_H_
#include
"schema.capnp.h"
#include
<capnp/schema.capnp.h>
namespace
capnp
{
...
...
c++/src/capnp/serialize-packed-test.c++
View file @
83d30c2f
...
...
@@ -22,7 +22,6 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "serialize-packed.h"
#include "test.capnp.h"
#include <kj/debug.h>
#include <gtest/gtest.h>
#include <string>
...
...
c++/src/capnp/serialize-test.c++
View file @
83d30c2f
...
...
@@ -23,7 +23,6 @@
#include "serialize.h"
#include <kj/debug.h>
#include "test.capnp.h"
#include <gtest/gtest.h>
#include <string>
#include <stdlib.h>
...
...
c++/src/capnp/test-util.h
View file @
83d30c2f
...
...
@@ -24,7 +24,7 @@
#ifndef CAPNP_TEST_UTIL_H_
#define CAPNP_TEST_UTIL_H_
#include
"test.capnp.h"
#include
<capnp/test.capnp.h>
#include <iostream>
#include "blob.h"
#include "dynamic.h"
...
...
compiler/src/Main.hs
View file @
83d30c2f
...
...
@@ -47,7 +47,7 @@ import qualified Data.Map as Map
import
qualified
Data.ByteString.Lazy.Char8
as
LZ
import
Data.ByteString
(
unpack
,
pack
,
hPut
)
import
Data.Word
(
Word64
,
Word8
)
import
Data.Maybe
(
fromMaybe
,
catMaybes
)
import
Data.Maybe
(
fromMaybe
,
catMaybes
,
mapMaybe
)
import
Data.Function
(
on
)
import
Semantics
import
WireFormat
(
encodeSchema
)
...
...
@@ -61,6 +61,7 @@ generatorFns = Map.fromList [ ("c++", generateCxx) ]
data
Opt
=
SearchPathOpt
FilePath
|
OutputOpt
String
GeneratorFn
FilePath
|
SrcPrefixOpt
String
|
VerboseOpt
|
HelpOpt
|
GenIdOpt
...
...
@@ -70,11 +71,16 @@ main = do
let
optionDescs
=
[
Option
"I"
[
"import-path"
]
(
ReqArg
SearchPathOpt
"DIR"
)
"Search DIR for absolute imports."
,
Option
""
[
"src-prefix"
]
(
ReqArg
SrcPrefixOpt
"PREFIX"
)
"Prefix directory to strip off of source
\n\
\
file names before generating output file
\n\
\
names."
,
Option
"o"
[
"output"
]
(
ReqArg
parseOutputArg
"LANG[:DIR]"
)
(
"Generate output for language LANG
\n\
\
to directory DIR (default: current
\n\
\
directory). LANG may be any of:
\n\
\
"
++
unwords
(
Map
.
keys
generatorFns
))
\
"
++
unwords
(
Map
.
keys
generatorFns
)
++
"
\n\
\
or a plugin name."
)
,
Option
"v"
[
"verbose"
]
(
NoArg
VerboseOpt
)
"Write information about parsed files."
,
Option
"i"
[
"generate-id"
]
(
NoArg
GenIdOpt
)
"Generate a new unique ID."
,
Option
"h"
[
"help"
]
(
NoArg
HelpOpt
)
"Print usage info and exit."
...
...
@@ -114,6 +120,11 @@ main = do
-- these hard-coded default paths.
let
searchPath
=
[
"/usr/local/include"
,
"/usr/include"
]
++
[
dir
|
SearchPathOpt
dir
<-
options
]
srcPrefixes
=
[
addTrailingSlash
prefix
|
SrcPrefixOpt
prefix
<-
options
]
addTrailingSlash
path
=
if
not
(
null
path
)
&&
last
path
/=
'/'
then
path
++
"/"
else
path
let
verifyDirectoryExists
dir
=
do
exists
<-
doesDirectoryExist
dir
...
...
@@ -143,7 +154,7 @@ main = do
\
be easy enough to grep, right?"
exitFailure
)
mapM_
(
doOutput
requestedFiles
schema
schemaMap
)
outputs
mapM_
(
doOutput
requestedFiles
s
rcPrefixes
s
chema
schemaMap
)
outputs
when
failed
exitFailure
...
...
@@ -293,9 +304,12 @@ handleFile isVerbose searchPath filename = do
Right
_
->
return
Nothing
Left
desc
->
return
$
Just
desc
doOutput
requestedFiles
schema
schemaMap
output
=
do
doOutput
requestedFiles
s
rcPrefixes
s
chema
schemaMap
output
=
do
let
write
dir
(
name
,
content
)
=
do
let
outFilename
=
dir
++
"/"
++
name
let
strippedOptions
=
mapMaybe
(
flip
List
.
stripPrefix
name
)
srcPrefixes
stripped
=
if
null
strippedOptions
then
name
else
List
.
minimumBy
(
compare
`
on
`
length
)
strippedOptions
outFilename
=
dir
++
"/"
++
stripped
createDirectoryIfMissing
True
$
takeDirectory
outFilename
LZ
.
writeFile
outFilename
content
generate
(
generatorFn
,
dir
)
=
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment