Skip to content

Commit

Permalink
use cbindgen for wzmq
Browse files Browse the repository at this point in the history
  • Loading branch information
jkarneges committed Jun 18, 2024
1 parent 87075c9 commit 4d70985
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 196 deletions.
6 changes: 6 additions & 0 deletions cbindgen.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
include_guard = "RUST_BINDINGS_H"
namespace = "ffi"

after_includes = """
// zmq crate version 0.10 bundles zeromq 4.3
#define WZMQ_VERSION_MAJOR 4
#define WZMQ_VERSION_MINOR 3
"""

[parse]
parse_deps = true
include = ["jsonwebtoken", "zmq"]
3 changes: 0 additions & 3 deletions src/cpp/cpp.pri
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ INCLUDEPATH += $$PWD/../../target/include

SRC_DIR = $$PWD
QZMQ_DIR = $$SRC_DIR/qzmq
RUST_DIR = $$SRC_DIR/..

INCLUDEPATH += $$SRC_DIR
INCLUDEPATH += $$QZMQ_DIR/src
Expand All @@ -16,8 +15,6 @@ DEFINES += NO_IRISNET
HEADERS += $$SRC_DIR/processquit.h
SOURCES += $$SRC_DIR/processquit.cpp

INCLUDEPATH += $$RUST_DIR

HEADERS += \
$$SRC_DIR/tnetstring.h \
$$SRC_DIR/httpheaders.h \
Expand Down
4 changes: 3 additions & 1 deletion src/cpp/qzmq/src/qzmqcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
#include "qzmqcontext.h"

#include <assert.h>
#include "rust/wzmq.h"
#include "rust/bindings.h"

using namespace ffi;

namespace QZmq {

Expand Down
4 changes: 3 additions & 1 deletion src/cpp/qzmq/src/qzmqsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
#include <QTimer>
#include <QSocketNotifier>
#include <QMutex>
#include "rust/wzmq.h"
#include "rust/bindings.h"
#include "qzmqcontext.h"

using namespace ffi;

namespace QZmq {

static int get_fd(void *sock)
Expand Down
3 changes: 0 additions & 3 deletions src/cpp/tests/tests.pro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ OBJECTS_DIR = $$cpp_build_dir/test-obj

SRC_DIR = $$PWD/..
QZMQ_DIR = $$SRC_DIR/qzmq
RUST_DIR = $$SRC_DIR/..

include($$cpp_build_dir/conf.pri)

Expand All @@ -26,8 +25,6 @@ INCLUDEPATH += $$QZMQ_DIR/src

DEFINES += NO_IRISNET

INCLUDEPATH += $$RUST_DIR

INCLUDES += \
main.h

Expand Down
Loading

0 comments on commit 4d70985

Please sign in to comment.