diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt new file mode 100644 index 000000000..a3e7f145a --- /dev/null +++ b/zephyr/CMakeLists.txt @@ -0,0 +1,46 @@ +if(CONFIG_ZENOH_PICO) + +zephyr_compile_definitions(ZENOH_ZEPHYR) +zephyr_include_directories(../include) +zephyr_library() + +function(configure_zenoh_feature config) + string(REPLACE CONFIG_ZENOH_PICO Z_FEATURE feature ${config}) + if(${config}) + zephyr_compile_definitions(${feature}=1) + else() + zephyr_compile_definitions(${feature}=0) + endif() +endfunction() + + +configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_SERIAL) +configure_zenoh_feature(CONFIG_ZENOH_PICO_MULTI_THREAD) +configure_zenoh_feature(CONFIG_ZENOH_PICO_PUBLICATION) +configure_zenoh_feature(CONFIG_ZENOH_PICO_SUBSCRIPTION) +configure_zenoh_feature(CONFIG_ZENOH_PICO_QUERY) +configure_zenoh_feature(CONFIG_ZENOH_PICO_QUERYABLE) +configure_zenoh_feature(CONFIG_ZENOH_PICO_RAWETH_TRANSPORT) +configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_TCP) +configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_UDP_UNICAST) +configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_UDP_MULTICAST) +configure_zenoh_feature(CONFIG_ZENOH_PICO_SCOUTING_UDP) +configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_WS) + + +file(GLOB_RECURSE Sources + "../src/api/*.c" + "../src/collections/*.c" + "../src/deprecated/*.c" + "../src/link/*.c" + "../src/net/*.c" + "../src/protocol/*.c" + "../src/session/*.c" + "../src/transport/*.c" + "../src/utils/*.c" +) + +file (GLOB Sources_Zephyr "../src/system/zephyr/*.c") +list(APPEND Sources ${Sources_Zephyr}) +zephyr_library_sources(${Sources}) +endif() diff --git a/zephyr/Kconfig.zenoh b/zephyr/Kconfig.zenoh new file mode 100644 index 000000000..fce27a370 --- /dev/null +++ b/zephyr/Kconfig.zenoh @@ -0,0 +1,69 @@ +config ZENOH_PICO + bool "Zenoh PICO library" + help + Enable Zenoh pico support + +if ZENOH_PICO + +config ZENOH_PICO_LINK_SERIAL + bool "Serial Link" + help + Use serial link + +config ZENOH_PICO_MULTI_THREAD + bool "Multithreading support" + help + Multithreading support + +config ZENOH_PICO_PUBLICATION + bool "Publication Support" + help + Publication support + +config ZENOH_PICO_SUBSCRIPTION + bool "Subscription Support" + help + Subscription Support + +config ZENOH_PICO_QUERY + bool "Query Support" + help + Query Support + +config ZENOH_PICO_QUERYABLE + bool "Queryable Support" + help + Queryable Support + +config ZENOH_PICO_RAWETH_TRANSPORT + bool "Raw Ethernet Support" + help + Raw Ethernet Support + +config ZENOH_PICO_LINK_TCP + bool "TCP Link" + help + TCP Link + +config ZENOH_PICO_LINK_UDP_UNICAST + bool "UDP Unicast" + help + UDP Unicast + +config ZENOH_PICO_LINK_UDP_MULTICAST + bool "UDP Multicast" + help + UDP Multicast + +config ZENOH_PICO_SCOUTING_UDP + bool "Scouting UDP" + help + Scouting UDP + +config ZENOH_PICO_LINK_WS + bool "WS Link" + help + WS Link + +endif + diff --git a/zephyr/module.yml b/zephyr/module.yml index 31f5d4f30..507856e5e 100644 --- a/zephyr/module.yml +++ b/zephyr/module.yml @@ -1,4 +1,4 @@ name: zenoh-pico build: - cmake-ext: True - kconfig-ext: True + cmake: zephyr/ + kconfig: zephyr/Kconfig.zenoh