fix cmake
This commit is contained in:
parent
5d64af4841
commit
45a69c993f
3 changed files with 6 additions and 5 deletions
|
|
@ -9,8 +9,8 @@ project(c-capnproto LANGUAGES ${languages})
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 11)
|
# set(CMAKE_C_STANDARD 11)
|
||||||
set(CMAKE_C_EXTENSIONS NO)
|
# set(CMAKE_C_EXTENSIONS NO)
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
set(CMAKE_CXX_STANDARD 20)
|
set(CMAKE_CXX_STANDARD 20)
|
||||||
set(CMAKE_CXX_EXTENSIONS NO)
|
set(CMAKE_CXX_EXTENSIONS NO)
|
||||||
|
|
@ -170,6 +170,7 @@ if(C_CAPNPROTO_ENABLE_INSTALL)
|
||||||
install(FILES lib/capnp_c.h TYPE INCLUDE)
|
install(FILES lib/capnp_c.h TYPE INCLUDE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(examples/book)
|
||||||
if(BUILD_TESTING AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
if(BUILD_TESTING AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -2017,11 +2017,11 @@ static void define_struct(capnp_ctx_t *ctx, struct node *n, const char *extattr,
|
||||||
&(ctx->SRC),
|
&(ctx->SRC),
|
||||||
"\nvoid encode_%s(struct capn_segment *cs,struct %s *d, %s *s) {\n",
|
"\nvoid encode_%s(struct capn_segment *cs,struct %s *d, %s *s) {\n",
|
||||||
n->name.str, n->name.str, buf);
|
n->name.str, n->name.str, buf);
|
||||||
str_addf(&(ctx->SRC), "%s\n", s.encoder);
|
str_addf(&(ctx->SRC), "%s\n", s.encoder.str);
|
||||||
str_addf(&(ctx->SRC), "}\n");
|
str_addf(&(ctx->SRC), "}\n");
|
||||||
str_addf(&(ctx->SRC), "\nvoid decode_%s(%s *d, struct %s *s) {\n",
|
str_addf(&(ctx->SRC), "\nvoid decode_%s(%s *d, struct %s *s) {\n",
|
||||||
n->name.str, buf, n->name.str);
|
n->name.str, buf, n->name.str);
|
||||||
str_addf(&(ctx->SRC), "%s\n", s.decoder);
|
str_addf(&(ctx->SRC), "%s\n", s.decoder.str);
|
||||||
str_addf(&(ctx->SRC), "}\n");
|
str_addf(&(ctx->SRC), "}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
static void usage(char *app) {
|
static void usage(char *app) {
|
||||||
fprintf(stderr, "usage: %s encode | %s decode\n",
|
fprintf(stderr, "usage: %s encode | %s decode\n",
|
||||||
app);
|
app, app);
|
||||||
}
|
}
|
||||||
|
|
||||||
int encode() {
|
int encode() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue