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
4b31d5a2
Commit
4b31d5a2
authored
Dec 09, 2014
by
Kenton Varda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:kentonv/capnproto
parents
36df9e4c
f86de2e8
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
52 deletions
+90
-52
CMakeLists.txt
CMakeLists.txt
+5
-1
CMakeLists.txt
c++/CMakeLists.txt
+30
-20
CMakeLists.txt
c++/src/CMakeLists.txt
+23
-7
layout.c++
c++/src/capnp/layout.c++
+1
-1
rpc.capnp
c++/src/capnp/rpc.capnp
+1
-1
schema.capnp
c++/src/capnp/schema.capnp
+2
-2
CMakeLists.txt
c++/src/kj/CMakeLists.txt
+26
-18
async-io.c++
c++/src/kj/async-io.c++
+1
-1
common.h
c++/src/kj/common.h
+1
-1
No files found.
CMakeLists.txt
View file @
4b31d5a2
...
...
@@ -4,7 +4,11 @@ cmake_minimum_required(VERSION 2.8)
set
(
CMAKE_MODULE_PATH
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/cmake"
)
include
(
CheckIncludeFileCXX
)
check_include_file_cxx
(
initializer_list HAS_CXX11
"-std=c++11"
)
if
(
MSVC
)
check_include_file_cxx
(
initializer_list HAS_CXX11
)
else
()
check_include_file_cxx
(
initializer_list HAS_CXX11
"-std=c++11"
)
endif
()
if
(
NOT HAS_CXX11
)
message
(
SEND_ERROR
"Requires a C++11 compiler and standard library."
)
endif
()
...
...
c++/CMakeLists.txt
View file @
4b31d5a2
...
...
@@ -22,13 +22,21 @@ if(CAPNP_LITE AND BUILD_TOOLS)
message
(
WARNING
"Command-line tools will not be built with CAPNP_LITE."
)
endif
()
if
(
MSVC AND NOT CAPNP_LITE
)
message
(
SEND_ERROR
"Building with MSVC is only supported with CAPNP_LITE."
)
endif
()
if
(
CAPNP_LITE
)
set
(
CAPNP_LITE_FLAG
"-DCAPNP_LITE"
)
else
()
set
(
CAPNP_LITE_FLAG
)
endif
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -Wno-unused-parameter -std=c++11 -pthread
${
CAPNP_LITE_FLAG
}
"
)
if
(
MSVC
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
/W3
${
CAPNP_LITE_FLAG
}
"
)
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wall -Wextra -Wno-unused-parameter -std=c++11 -pthread
${
CAPNP_LITE_FLAG
}
"
)
endif
()
# Source =======================================================================
...
...
@@ -36,25 +44,27 @@ add_subdirectory(src)
# Install ======================================================================
# Variables for pkg-config files
set
(
prefix
"
${
CMAKE_INSTALL_PREFIX
}
"
)
set
(
exec_prefix
"
${
EXEC_INSTALL_PREFIX
}
"
)
set
(
libdir
"
${
LIB_INSTALL_DIR
}
"
)
set
(
includedir
"
${
INCLUDE_INSTALL_DIR
}
"
)
set
(
PTHREAD_CFLAGS
"-pthread"
)
set
(
STDLIB_FLAG
)
# TODO: Unsupported
if
(
NOT MSVC
)
# Don't install pkg-config files when building with MSVC
# Variables for pkg-config files
set
(
prefix
"
${
CMAKE_INSTALL_PREFIX
}
"
)
set
(
exec_prefix
"
${
EXEC_INSTALL_PREFIX
}
"
)
set
(
libdir
"
${
LIB_INSTALL_DIR
}
"
)
set
(
includedir
"
${
INCLUDE_INSTALL_DIR
}
"
)
set
(
PTHREAD_CFLAGS
"-pthread"
)
set
(
STDLIB_FLAG
)
# TODO: Unsupported
configure_file
(
capnp.pc.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp.pc"
@ONLY
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp.pc"
DESTINATION
"
${
LIB_INSTALL_DIR
}
/pkgconfig"
)
configure_file
(
capnp.pc.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp.pc"
@ONLY
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp.pc"
DESTINATION
"
${
LIB_INSTALL_DIR
}
/pkgconfig"
)
if
(
NOT CAPNP_LITE
)
configure_file
(
capnp-rpc.pc.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp-rpc.pc"
@ONLY
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp-rpc.pc"
DESTINATION
"
${
LIB_INSTALL_DIR
}
/pkgconfig"
)
endif
()
if
(
NOT CAPNP_LITE
)
configure_file
(
capnp-rpc.pc.in
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp-rpc.pc"
@ONLY
)
install
(
FILES
"
${
CMAKE_CURRENT_BINARY_DIR
}
/capnp-rpc.pc"
DESTINATION
"
${
LIB_INSTALL_DIR
}
/pkgconfig"
)
endif
()
unset
(
STDLIB_FLAG
)
unset
(
PTHREAD_CFLAGS
)
unset
(
includedir
)
unset
(
libdir
)
unset
(
exec_prefix
)
unset
(
prefix
)
unset
(
STDLIB_FLAG
)
unset
(
PTHREAD_CFLAGS
)
unset
(
includedir
)
unset
(
libdir
)
unset
(
exec_prefix
)
unset
(
prefix
)
endif
()
c++/src/CMakeLists.txt
View file @
4b31d5a2
...
...
@@ -15,22 +15,38 @@ if(BUILD_TESTING)
ExternalProject_Add
(
gtest_build
URL http://googletest.googlecode.com/files/gtest-1.7.0.zip
URL_MD5 2d6ec8ccdf5c46b05ba54a9fd1d130d7
CMAKE_ARGS -DCMAKE_BUILD_TYPE=
${
CMAKE_BUILD_TYPE
}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=
${
CMAKE_BUILD_TYPE
}
-Dgtest_force_shared_crt=1
INSTALL_COMMAND
""
# Disable install
)
ExternalProject_Get_Property
(
gtest_build binary_dir
)
# Set platform-specific library prefix/extensions.
if
(
MSVC
)
set
(
gtest_prefix
)
set
(
gtest_suffix
".lib"
)
else
()
set
(
gtest_prefix
"lib"
)
set
(
gtest_suffix
".a"
)
endif
()
add_library
(
gtest UNKNOWN IMPORTED
)
set_property
(
TARGET gtest
PROPERTY IMPORTED_LOCATION
"
${
binary_dir
}
/
${
CMAKE_FIND_LIBRARY_PREFIXES
}
gtest.a"
)
if
(
CMAKE_GENERATOR MATCHES
"Visual Studio.*"
OR CMAKE_GENERATOR STREQUAL Xcode
)
set_target_properties
(
gtest PROPERTIES IMPORTED_LOCATION_DEBUG
"
${
binary_dir
}
/Debug/
${
gtest_prefix
}
gtest
${
gtest_suffix
}
"
)
set_target_properties
(
gtest PROPERTIES IMPORTED_LOCATION_RELEASE
"
${
binary_dir
}
/Release/
${
gtest_prefix
}
gtest
${
gtest_suffix
}
"
)
else
()
set_target_properties
(
gtest PROPERTIES IMPORTED_LOCATION
"
${
binary_dir
}
/
${
gtest_prefix
}
gtest
${
gtest_suffix
}
"
)
endif
()
add_dependencies
(
gtest gtest_build
)
add_library
(
gtest_main UNKNOWN IMPORTED
)
set_property
(
TARGET gtest_main
PROPERTY IMPORTED_LOCATION
"
${
binary_dir
}
/
${
CMAKE_FIND_LIBRARY_PREFIXES
}
gtest_main.a"
)
if
(
CMAKE_GENERATOR MATCHES
"Visual Studio.*"
OR CMAKE_GENERATOR STREQUAL Xcode
)
set_target_properties
(
gtest_main PROPERTIES IMPORTED_LOCATION_DEBUG
"
${
binary_dir
}
/Debug/
${
gtest_prefix
}
gtest_main
${
gtest_suffix
}
"
)
set_target_properties
(
gtest_main PROPERTIES IMPORTED_LOCATION_RELEASE
"
${
binary_dir
}
/Release/
${
gtest_prefix
}
gtest_main
${
gtest_suffix
}
"
)
else
()
set_target_properties
(
gtest_main PROPERTIES IMPORTED_LOCATION
"
${
binary_dir
}
/
${
gtest_prefix
}
gtest_main
${
gtest_suffix
}
"
)
endif
()
add_dependencies
(
gtest_main gtest
)
ExternalProject_Get_Property
(
gtest_build source_dir
)
...
...
c++/src/capnp/layout.c++
View file @
4b31d5a2
...
...
@@ -1069,7 +1069,7 @@ struct WireHelpers {
}
// We must verify that the pointer has the right size. Unlike in
// getWritableStructList
Reference
(), we never need to "upgrade" the data, because this
// getWritableStructList
Pointer
(), we never need to "upgrade" the data, because this
// method is called only for non-struct lists, and there is no allowed upgrade path *to*
// a non-struct list, only *from* them.
...
...
c++/src/capnp/rpc.capnp
View file @
4b31d5a2
...
...
@@ -1061,7 +1061,7 @@ struct Exception {
# - Bugs.
# - Invalid input.
# - Configuration errors.
# - Network probles.
# - Network proble
m
s.
# - Insufficient resources.
# - Version skew (unimplemented functionality).
# - Other logistical problems.
...
...
c++/src/capnp/schema.capnp
View file @
4b31d5a2
...
...
@@ -65,7 +65,7 @@ struct Node {
struct NestedNode {
name @0 :Text;
# Unqualified symbol name. Unlike Node.
n
ame, this *can* be used programmatically.
# Unqualified symbol name. Unlike Node.
displayN
ame, this *can* be used programmatically.
#
# (On Zooko's triangle, this is the node's petname according to its parent scope.)
...
...
@@ -361,7 +361,7 @@ struct Brand {
# List of parameter bindings.
inherit @2 :Void;
# The place where this
TypeEnivornment
appears is actually within this scope or a sub-scope,
# The place where this
Brand
appears is actually within this scope or a sub-scope,
# and the bindings for this scope should be inherited from the reference point.
}
}
...
...
c++/src/kj/CMakeLists.txt
View file @
4b31d5a2
# kj ===========================================================================
set
(
kj_sources
common.c++
units.c++
memory.c++
refcount.c++
set
(
kj_sources_lite
array.c++
string.c++
string-tree.c++
exception.c++
common.c++
debug.c++
arena
.c++
exception
.c++
io.c++
memory.c++
mutex.c++
string.c++
thread.c++
)
set
(
kj_sources_heavy
units.c++
refcount.c++
string-tree.c++
arena.c++
main.c++
parse/char.c++
)
if
(
NOT CAPNP_LITE
)
set
(
kj_sources
${
kj_sources_lite
}
${
kj_sources_heavy
}
)
else
()
set
(
kj_sources
${
kj_sources_lite
}
)
endif
()
set
(
kj_headers
common.h
units.h
...
...
@@ -81,21 +89,14 @@ if(BUILD_TESTING)
add_executable
(
kj-tests
common-test.c++
memory-test.c++
refcount-test.c++
array-test.c++
string-test.c++
string-tree-test.c++
exception-test.c++
debug-test.c++
arena-test.c++
units-test.c++
tuple-test.c++
one-of-test.c++
function-test.c++
io-test.c++
mutex-test.c++
threadlocal-test.c++
threadlocal-pthread
-test.c++
std/iostream
-test.c++
)
# TODO: Link with librt on Solaris for sched_yield
target_link_libraries
(
kj-tests kj gtest gtest_main
)
...
...
@@ -107,9 +108,16 @@ if(BUILD_TESTING)
async-test.c++
async-unix-test.c++
async-io-test.c++
refcount-test.c++
string-tree-test.c++
arena-test.c++
units-test.c++
tuple-test.c++
one-of-test.c++
function-test.c++
threadlocal-pthread-test.c++
parse/common-test.c++
parse/char-test.c++
std/iostream-test.c++
)
target_link_libraries
(
kj-heavy-tests kj kj-async gtest gtest_main
)
add_dependencies
(
check kj-heavy-tests
)
...
...
c++/src/kj/async-io.c++
View file @
4b31d5a2
...
...
@@ -191,7 +191,7 @@ public:
if
(
pollResult
==
0
)
{
// Not ready yet. We can safely use the edge-triggered observer.
return
observer
.
whenBecomes
Read
able
();
return
observer
.
whenBecomes
Writ
able
();
}
else
{
// Ready now.
return
kj
::
READY_NOW
;
...
...
c++/src/kj/common.h
View file @
4b31d5a2
...
...
@@ -1088,7 +1088,7 @@ public:
inline
constexpr
ArrayPtr
(
decltype
(
nullptr
))
:
ptr
(
nullptr
),
size_
(
0
)
{}
inline
constexpr
ArrayPtr
(
T
*
ptr
,
size_t
size
)
:
ptr
(
ptr
),
size_
(
size
)
{}
inline
constexpr
ArrayPtr
(
T
*
begin
,
T
*
end
)
:
ptr
(
begin
),
size_
(
end
-
begin
)
{}
inline
KJ_CONSTEXPR
()
ArrayPtr
(
std
::
initializer_list
<
RemoveConstOrDisable
<
T
>>
init
)
inline
KJ_CONSTEXPR
()
ArrayPtr
(
::
std
::
initializer_list
<
RemoveConstOrDisable
<
T
>>
init
)
:
ptr
(
init
.
begin
()),
size_
(
init
.
size
())
{}
template
<
size_t
size
>
...
...
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