Skip to content

Commit

Permalink
init my builkd
Browse files Browse the repository at this point in the history
  • Loading branch information
daleydeng committed Dec 29, 2024
1 parent 7a35020 commit bcd088f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
16 changes: 16 additions & 0 deletions conda_recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

cd ./install
rm -rf build
mkdir build
cd build

cmake ${CMAKE_ARGS} -GNinja $SRC_DIR \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING:BOOL=OFF \
-DZENOHCXX_ZENOHC:BOOL=ON \
-DZENOHCXX_ZENOHPICO:BOOL=OFF \
-DZENOHCXX_EXAMPLES_PROTOBUF:BOOL=OFF

cmake --build . --config Release
cmake --build . --config Release --target install
33 changes: 33 additions & 0 deletions conda_recipe/fix_queryable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/examples/universal/z_queryable.cxx b/examples/universal/z_queryable.cxx
index ac145ee..b334608 100644
--- a/examples/universal/z_queryable.cxx
+++ b/examples/universal/z_queryable.cxx
@@ -60,14 +60,14 @@ int _main(int argc, char **argv) {
}
std::cout << "'\n";
std::cout << "[Queryable ] Responding ('" << keyexpr << "': '" << payload << "')\n";
- query.reply(keyexpr, payload);
+ query.reply(KeyExpr(keyexpr), payload);
};

auto on_drop_queryable = []() { std::cout << "Destroying queryable\n"; };

Session::QueryableOptions opts;
opts.complete = args.flag("complete");
- auto queryable = session.declare_queryable(keyexpr, on_query, on_drop_queryable, std::move(opts));
+ auto queryable = session.declare_queryable(KeyExpr(keyexpr), on_query, on_drop_queryable, std::move(opts));

printf("Press CTRL-C to quit...\n");
while (true) {
diff --git a/include/zenoh/api/session.hxx b/include/zenoh/api/session.hxx
index f22c26b..563d183 100644
--- a/include/zenoh/api/session.hxx
+++ b/include/zenoh/api/session.hxx
@@ -26,6 +26,7 @@
#include "keyexpr.hxx"
#include "liveliness.hxx"
#include "publisher.hxx"
+#include "queryable.hxx"
#include "query_consolidation.hxx"
#include "subscriber.hxx"
#include "timestamp.hxx"
39 changes: 39 additions & 0 deletions conda_recipe/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
context:
name: zenoh-cpp
version: 1.1.0

package:
name: ${{ name }}
version: ${{ version }}

source:
- git: https://github.com/eclipse-zenoh/zenoh-cpp.git
tag: ${{ version }}
patches:
- fix_queryable.patch

build:
number: 1000

requirements:
build:
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
- cmake
- pkg-config
- ninja
host:
- zenoh-c ${{ version }}.*

tests:
- script:
- if: unix
then: test -f ${PREFIX}/include/zenoh.hxx
- if: win
then: if not exist %LIBRARY_PREFIX%\\include\\zenoh.hxx exit 1

about:
license: Apache-2.0 OR EPL-2.0
license_file: LICENSE
summary: C++ API for zenoh
homepage: https://github.com/eclipse-zenoh/zenoh-cpp

0 comments on commit bcd088f

Please sign in to comment.