diff --git a/msg/CMakeLists.txt b/msg/CMakeLists.txt index 4db75e68d84..0f62315b2c6 100644 --- a/msg/CMakeLists.txt +++ b/msg/CMakeLists.txt @@ -624,7 +624,8 @@ if(CONFIG_MODULES_ZENOH) COMMENT "Generating Zenoh Topic Code" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} VERBATIM - ) - add_library(zenoh_topics ${PX4_BINARY_DIR}/src/modules/zenoh/uorb_pubsub_factory.hpp) - set_target_properties(zenoh_topics PROPERTIES LINKER_LANGUAGE CXX) + ) + add_custom_target(zenoh_topics + DEPENDS ${PX4_BINARY_DIR}/src/modules/zenoh/uorb_pubsub_factory.hpp + ) endif() diff --git a/src/modules/zenoh/CMakeLists.txt b/src/modules/zenoh/CMakeLists.txt index 9e576d17871..f927bae2504 100644 --- a/src/modules/zenoh/CMakeLists.txt +++ b/src/modules/zenoh/CMakeLists.txt @@ -37,7 +37,9 @@ function(message) endif() endfunction() -set(POSIX_COMPATIBLE YES) +if(NOT APPLE) + set(POSIX_COMPATIBLE YES) +endif() set(BUILD_SHARED_LIBS OFF) set(BUILD_TESTING OFF) set(CHECK_THREADS NO) diff --git a/src/modules/zenoh/subscribers/uorb_subscriber.hpp b/src/modules/zenoh/subscribers/uorb_subscriber.hpp index 8843aee6c96..649445340f4 100644 --- a/src/modules/zenoh/subscribers/uorb_subscriber.hpp +++ b/src/modules/zenoh/subscribers/uorb_subscriber.hpp @@ -73,7 +73,7 @@ public: } // Update the uORB Subscription and broadcast a Zenoh ROS2 message - void data_handler(const z_loaned_sample_t *sample) + void data_handler(const z_loaned_sample_t *sample) override { char data[_uorb_meta->o_size + CDR_SAFETY_MARGIN]; @@ -133,7 +133,7 @@ public: memcpy(data, &now, sizeof(hrt_abstime)); } - void print() + void print() override { Zenoh_Subscriber::print("uORB", _uorb_meta->o_name); }