build: enable building protobuf-c and streaming support
This is a simple enough change. However, there are no tests for the streaming functionality, and I need to decide if I want to actually try to write bindings for them.
This commit is contained in:
parent
7794532fb4
commit
99daf922fd
@ -26,9 +26,12 @@ pub fn nats_c_lib(
|
|||||||
lib.linkLibC();
|
lib.linkLibC();
|
||||||
lib.addCSourceFiles(&common_sources, &cflags);
|
lib.addCSourceFiles(&common_sources, &cflags);
|
||||||
lib.addIncludePath(.{ .path = nats_src_prefix ++ "include" });
|
lib.addIncludePath(.{ .path = nats_src_prefix ++ "include" });
|
||||||
// if building with streaming support
|
// if building with streaming support (protocol.pb-c.c includes
|
||||||
// lib.addIncludePath(.{ .path = nats_src_prefix ++ "stan" });
|
// <protobuf-c/protobuf-c.h>, unfortunately)
|
||||||
// lib.addCSourceFiles(&streaming_sources, &cflags);
|
lib.addIncludePath(.{ .path = "deps" });
|
||||||
|
lib.addIncludePath(.{ .path = nats_src_prefix ++ "stan" });
|
||||||
|
lib.addCSourceFiles(&streaming_sources, &cflags);
|
||||||
|
lib.addCSourceFiles(&protobuf_c_sources, &cflags);
|
||||||
|
|
||||||
const ssl_dep = b.dependency("libressl", .{
|
const ssl_dep = b.dependency("libressl", .{
|
||||||
.target = options.target,
|
.target = options.target,
|
||||||
@ -62,6 +65,7 @@ pub fn nats_c_lib(
|
|||||||
lib.defineCMacro("NATS_HAS_TLS", null);
|
lib.defineCMacro("NATS_HAS_TLS", null);
|
||||||
lib.defineCMacro("NATS_USE_OPENSSL_1_1", null);
|
lib.defineCMacro("NATS_USE_OPENSSL_1_1", null);
|
||||||
lib.defineCMacro("NATS_FORCE_HOST_VERIFICATION", null);
|
lib.defineCMacro("NATS_FORCE_HOST_VERIFICATION", null);
|
||||||
|
lib.defineCMacro("NATS_HAS_STREAMING", null);
|
||||||
lib.defineCMacro("_REENTRANT", null);
|
lib.defineCMacro("_REENTRANT", null);
|
||||||
|
|
||||||
inline for (install_headers) |header| {
|
inline for (install_headers) |header| {
|
||||||
@ -141,3 +145,7 @@ const streaming_sources = [_][]const u8{
|
|||||||
nats_src_prefix ++ "stan/sopts.c",
|
nats_src_prefix ++ "stan/sopts.c",
|
||||||
nats_src_prefix ++ "stan/sub.c",
|
nats_src_prefix ++ "stan/sub.c",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const protobuf_c_sources = [_][]const u8{
|
||||||
|
"deps/protobuf-c/protobuf-c.c",
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user