From 918e7163ef287ed0fde601c916c01a4e65547ba4 Mon Sep 17 00:00:00 2001 From: Francesco Emanuele D'Agostino Date: Tue, 18 Nov 2025 17:41:38 +0100 Subject: [PATCH 1/4] fetch for zenoh-c and zenoh-pico --- cmake/zenoh-c.cmake | 9 +++++++++ cmake/zenoh-pico.cmake | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 cmake/zenoh-c.cmake create mode 100644 cmake/zenoh-pico.cmake diff --git a/cmake/zenoh-c.cmake b/cmake/zenoh-c.cmake new file mode 100644 index 00000000..2c0250b8 --- /dev/null +++ b/cmake/zenoh-c.cmake @@ -0,0 +1,9 @@ + +FetchContent_Declare( + zenohc + GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-c.git + GIT_TAG main + GIT_SHALLOW TRUE +) + +FetchContent_MakeAvailable(zenohc) diff --git a/cmake/zenoh-pico.cmake b/cmake/zenoh-pico.cmake new file mode 100644 index 00000000..3303e3b8 --- /dev/null +++ b/cmake/zenoh-pico.cmake @@ -0,0 +1,9 @@ + +FetchContent_Declare( + zenohpico + GIT_REPOSITORY https://github.com/eclipse-zenoh/zenoh-pico.git + GIT_TAG main + GIT_SHALLOW TRUE +) + +FetchContent_MakeAvailable(zenohpico) From c68a43082c794982206357a0636a290ca5feb945 Mon Sep 17 00:00:00 2001 From: Francesco Emanuele D'Agostino Date: Tue, 18 Nov 2025 17:43:42 +0100 Subject: [PATCH 2/4] fetching dependencies in the local build --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 13e69a8d..6d601711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,9 @@ add_library(zenohcxx INTERFACE) target_include_directories(zenohcxx INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include") if(ZENOHCXX_ZENOHPICO) + include(FetchContent) + include(zenoh-pico) + if(NOT TARGET zenohpico::lib) # Only find if target is not already available find_package(zenohpico REQUIRED) endif() @@ -58,6 +61,9 @@ if(ZENOHCXX_ZENOHPICO) endif() if(ZENOHCXX_ZENOHC) + include(FetchContent) + include(zenoh-c) + if(NOT TARGET zenohc::lib) # Only find if target is not already available find_package(zenohc REQUIRED) endif() From f3e0e5c7b568d46c7edf6d2c316e0207310004e6 Mon Sep 17 00:00:00 2001 From: Francesco Emanuele D'Agostino Date: Tue, 18 Nov 2025 18:10:36 +0100 Subject: [PATCH 3/4] installation no more required --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index dcc7e20c..bd1ca6c0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,6 @@ C++ bindings are still under active development so the Zenoh team will highly ap ## Requirements The only hard requirement for building the library is a C++17-compliant compiler. -Using the library requires either [zenoh-c] or [zenoh-pico] to be installed. ------------------------------- From 5198276a63543067691a31a1b9d59c80139b9f82 Mon Sep 17 00:00:00 2001 From: Francesco Emanuele D'Agostino Date: Fri, 21 Nov 2025 10:27:01 +0100 Subject: [PATCH 4/4] disable warnings in order to support new compilers Initializers warnings should be fixed at zenoh-pico level. --- tests/build/warnings.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/build/warnings.cxx b/tests/build/warnings.cxx index b98afc6f..78ff75cc 100644 --- a/tests/build/warnings.cxx +++ b/tests/build/warnings.cxx @@ -13,12 +13,16 @@ // // Disable 'old-style-cast` warning for C headers only +// Disable 'pedantic` warning due to "ISO C++ forbids compound-literals [-Werror=pedantic]" +// Disable 'missing-field-initializers` warning doe to missing initializations #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4996) #else #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wold-style-cast" +#pragma GCC diagnostic ignored "-Wpedantic" +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" #endif #ifdef ZENOHCXX_ZENOHPICO @@ -38,4 +42,4 @@ using namespace zenoh; -int main() { return 0; } \ No newline at end of file +int main() { return 0; }