Skip to content

Commit

Permalink
Enable querier for zenoh-pico (#380)
Browse files Browse the repository at this point in the history
* Enable querier for zenoh-pico

* Disable querier when ZENOHPICO_FEATURE_QUERY disabled
  • Loading branch information
sashacmc authored Jan 27, 2025
1 parent 289de20 commit 2256f15
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ function(add_examples glob mode lib)
if ((${file} MATCHES "^.*liveliness.*$") AND NOT(ZENOHPICO_FEATURE_LIVELINESS))
continue()
endif()
if ((${file} MATCHES "^.*querier.*$") AND (NOT(ZENOHPICO_FEATURE_QUERY) OR NOT(ZENOHPICO_BUILD_WITH_UNSTABLE_API)))
continue()
endif()
endif()

add_example(${file} ${mode} ${lib})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int _main(int argc, char **argv) {
.named_value({"t", "target"}, "TARGET", "Query target (BEST_MATCHING | ALL | ALL_COMPLETE)",
"BEST_MATCHING")
.named_value({"o", "timeout"}, "TIMEOUT", "Timeout in ms (number)", "10000")
#if defined(Z_FEATURE_UNSTABLE_API)
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
.named_flag({"add-matching-listener"}, "Add matching listener")
#endif
.run();
Expand Down
2 changes: 1 addition & 1 deletion include/zenoh/api.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "api/session.hxx"
#include "api/subscriber.hxx"
#include "api/timestamp.hxx"
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#if (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_QUERY == 1) && defined(Z_FEATURE_UNSTABLE_API)
#include "api/querier.hxx"
#endif
#if defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)
Expand Down
4 changes: 2 additions & 2 deletions include/zenoh/api/querier.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#pragma once

#if defined(ZENOHCXX_ZENOHC)
#if (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_QUERY == 1) && defined(Z_FEATURE_UNSTABLE_API)

#include "../detail/closures_concrete.hxx"
#include "base.hxx"
Expand Down Expand Up @@ -253,4 +253,4 @@ class Querier : public Owned<::z_owned_querier_t> {
};

} // namespace zenoh
#endif
#endif
4 changes: 2 additions & 2 deletions include/zenoh/api/session.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "query_consolidation.hxx"
#include "subscriber.hxx"
#include "timestamp.hxx"
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#if (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_QUERY == 1) && defined(Z_FEATURE_UNSTABLE_API)
#include "querier.hxx"
#endif
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)
Expand Down Expand Up @@ -702,7 +702,7 @@ class Session : public Owned<::z_owned_session_t> {
}
#endif

#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
#if (defined(ZENOHCXX_ZENOHC) || Z_FEATURE_QUERY == 1) && defined(Z_FEATURE_UNSTABLE_API)
/// @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future
/// release.
/// @brief Options to be passed when declaring a ``Querier``.
Expand Down

0 comments on commit 2256f15

Please sign in to comment.