From 3208a68e05b460c138c28a2e276e9a8c63071a7a Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Thu, 21 May 2026 16:39:50 +0500 Subject: [PATCH 1/8] remove unsused include --- aether/ae_actions/time_sync.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/aether/ae_actions/time_sync.cpp b/aether/ae_actions/time_sync.cpp index 72cd17bf..c4db6e3d 100644 --- a/aether/ae_actions/time_sync.cpp +++ b/aether/ae_actions/time_sync.cpp @@ -29,8 +29,6 @@ # include "aether/cloud_connections/cloud_visit.h" # include "aether/cloud_connections/cloud_server_connection.h" -# include "third_party/stdexec/include/exec/create.hpp" - # include "aether/tele/tele.h" namespace ae { From 3d3041920eab4a79d1364ec0c151e1d1603aabf0 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Thu, 21 May 2026 16:40:04 +0500 Subject: [PATCH 2/8] try to add dependancies through CPM --- aether/CMakeLists.txt | 70 +++++++++++++++++++++++++++++++------------ cmake/CPM.cmake | 24 +++++++++++++++ 2 files changed, 75 insertions(+), 19 deletions(-) create mode 100644 cmake/CPM.cmake diff --git a/aether/CMakeLists.txt b/aether/CMakeLists.txt index 639cffec..4688271a 100644 --- a/aether/CMakeLists.txt +++ b/aether/CMakeLists.txt @@ -29,24 +29,50 @@ set(USER_CONFIG "" CACHE PATH "Path to user provided configuration header file") set(FS_INIT "" CACHE PATH "Path to user provided saved state header file") list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake) -include(repo_init) - -ae_update_dependencies() - -# list a common dependencies -list(APPEND common_dependencies - "../third_party/libbcrypt" - "../third_party/libhydrogen" - "../third_party/libsodium" - "../third_party/gcem" - "../third_party/etl" - "../third_party/aethernet-numeric" - "../third_party/stdexec" +# include(repo_init) + +# ae_update_dependencies() + +include(CPM) + +# For using CPM.cmake projects with external package managers, such as conan or vcpkg, +# setting the variable CPM_USE_LOCAL_PACKAGES will make CPM.cmake try to add a package through +# find_package first, and add it from source if it doesn't succeed. +# To avoid extra downloads it is recommend to set the CPM_SOURCE_CACHE environmental variable +# It is possible to override the consumer's dependency with the version by supplying +# the CMake option CPM__SOURCE set to the absolute path of the local library. + +CPMAddPackage("https://github.com/rg3/libbcrypt.git#master") +CPMAddPackage("https://github.com/jedisct1/libhydrogen.git#master") +CPMAddPackage("https://github.com/jedisct1/libsodium.git#master") +CPMAddPackage("https://github.com/aethernetio/gcem.git#master") +CPMAddPackage("https://github.com/aethernetio/aethernet-numeric.git#main") +CPMAddPackage( + URI "https://github.com/ETLCPP/etl.git" + GIT_TAG "20.44.2" + OPTIONS "GIT_DIR_LOOKUP_POLICY ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR" ) -set(STDEXEC_BUILD_EXAMPLES Off) +CPMAddPackage( + URI "https://github.com/aethernetio/stdexec.git#main" + OPTIONS "STDEXEC_BUILD_EXAMPLES OFF" +) + + + +# # list a common dependencies +# list(APPEND common_dependencies +# "../third_party/libbcrypt" +# "../third_party/libhydrogen" +# "../third_party/libsodium" +# "../third_party/gcem" +# "../third_party/etl" +# "../third_party/aethernet-numeric" +# "../third_party/stdexec" +# ) +# set(STDEXEC_BUILD_EXAMPLES Off) # for etl -set(GIT_DIR_LOOKUP_POLICY ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) +# set(GIT_DIR_LOOKUP_POLICY ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) list(APPEND aether_srcs "aether_app.cpp" @@ -287,10 +313,16 @@ endif() if(REGULAR_CMAKE_PROJECT) project(aether VERSION ${AE_PROJECT_VERSION} LANGUAGES CXX C) - set(CARES_BUILD_TOOLS OFF CACHE BOOL "" FORCE) - set(CARES_STATIC ON CACHE BOOL "" FORCE) - set(CARES_SHARED OFF CACHE BOOL "" FORCE) - list(APPEND common_dependencies "../third_party/c-ares") + CPMAddPackage( + URI "https://github.com/c-ares/c-ares.git#main" + OPTIONS "CARES_BUILD_TOOLS OFF" + "CARES_STATIC ON" + "CARES_SHARED OFF" + ) + # set(CARES_BUILD_TOOLS OFF CACHE BOOL "" FORCE) + # set(CARES_STATIC ON CACHE BOOL "" FORCE) + # set(CARES_SHARED OFF CACHE BOOL "" FORCE) + # list(APPEND common_dependencies "../third_party/c-ares") foreach(dep ${common_dependencies}) get_filename_component(DEP_NAME ${dep} NAME) diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake new file mode 100644 index 00000000..a4d79344 --- /dev/null +++ b/cmake/CPM.cmake @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: MIT +# +# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors + +set(CPM_DOWNLOAD_VERSION 0.42.3) +set(CPM_HASH_SUM "a609e875fd532b067174250f6abbc3dac22fe2d64869783fb1e80bda1625c844") + +if(CPM_SOURCE_CACHE) + set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +elseif(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +else() + set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") +endif() + +# Expand relative path. This is important if the provided path contains a tilde (~) +get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) + +file(DOWNLOAD + https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake + ${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} +) + +include(${CPM_DOWNLOAD_LOCATION}) From 7bbe56d09200851c9d0389f6e7b98c5a4dd8c555 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 25 May 2026 10:44:39 +0500 Subject: [PATCH 3/8] remove unity and stdexec --- .gitmodules | 10 ---------- third_party/Unity | 1 - third_party/stdexec | 1 - 3 files changed, 12 deletions(-) delete mode 160000 third_party/Unity delete mode 160000 third_party/stdexec diff --git a/.gitmodules b/.gitmodules index f6acfd3f..91f55a6e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,12 +22,6 @@ branch = master ignore = dirty -[submodule "third_party/Unity"] - path = third_party/Unity - url = https://github.com/ThrowTheSwitch/Unity.git - branch = master - ignore = dirty - [submodule "third_party/c-ares"] path = third_party/c-ares url = https://github.com/c-ares/c-ares.git @@ -60,7 +54,3 @@ path = third_party/gcem url = https://github.com/aethernetio/gcem.git branch = master -[submodule "third_party/stdexec"] - path = third_party/stdexec - url = https://github.com/aethernetio/stdexec.git - branch = main diff --git a/third_party/Unity b/third_party/Unity deleted file mode 160000 index 51d2db98..00000000 --- a/third_party/Unity +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 51d2db98e292545321fcf23999920622b5bcf772 diff --git a/third_party/stdexec b/third_party/stdexec deleted file mode 160000 index 331556e0..00000000 --- a/third_party/stdexec +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 331556e046e76452fc25dd7e9ff88eb47c55232d From c963321e3ef507797ce3cfd8c6ceda850f74b4d4 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Tue, 26 May 2026 14:33:23 +0500 Subject: [PATCH 4/8] add dependencies using CPM --- .gitmodules | 56 ---- aether/CMakeLists.txt | 370 ++++++++++------------- aether/actions/action_pool.h | 4 +- aether/ae_actions/ping.h | 2 +- aether/api_protocol/api_message.h | 2 +- aether/api_protocol/api_method.h | 2 +- aether/crypto/crypto_nonce.cpp | 4 +- aether/crypto/crypto_nonce.h | 5 +- aether/crypto/key.h | 9 +- aether/crypto/key_gen.cpp | 9 +- aether/crypto/sign.h | 4 +- aether/crypto/signed_key.cpp | 4 +- aether/executors/any_sender.h | 18 +- aether/executors/any_waiter.h | 2 +- aether/executors/async_waiter.h | 2 +- aether/executors/executors.h | 4 +- aether/executors/for_range.h | 2 +- aether/executors/make_sender.h | 4 +- aether/executors/scheduler_on_tasks.h | 2 +- aether/executors/sync_waiter.h | 2 +- aether/executors/waiter_traits.h | 2 +- aether/executors/with_timeout.h | 2 +- aether/format/format_time.h | 2 +- aether/registration/proof_of_work.cpp | 2 +- aether/server_keys.h | 2 +- aether/tasks/details/task_manager.h | 2 +- aether/tasks/details/task_queues.h | 2 +- aether/tele/traps/statistics_trap.h | 2 +- aether/transport/data_packet_collector.h | 2 +- aether/transport/packet_queue_manager.h | 2 +- aether/types/statistic_counter.h | 2 +- aether/write_action/buffer_write.h | 2 +- examples/cloud/CMakeLists.txt | 6 - tests/CMakeLists.txt | 23 +- tests/inline_tests/CMakeLists.txt | 13 + tests/test-actions/CMakeLists.txt | 2 +- tests/test-events/CMakeLists.txt | 2 +- tests/test-format/CMakeLists.txt | 2 +- tests/test-object-system/CMakeLists.txt | 2 +- tests/test-tasks/CMakeLists.txt | 2 +- tests/test-tasks/test-task-queues.cpp | 4 +- tests/test-tele/CMakeLists.txt | 2 +- tests/test-types/CMakeLists.txt | 2 +- tests/third_party_tests/CMakeLists.txt | 6 +- third_party/CMakeLists.libbcrypt | 83 ----- third_party/CMakeLists.libhydrogen | 67 ---- third_party/aethernet-numeric | 1 - third_party/base-n | 1 - third_party/c-ares | 1 - third_party/date | 1 - third_party/etl | 1 - third_party/etl.patch | 17 +- third_party/gcem | 1 - third_party/ini.h | 1 - third_party/libbcrypt | 1 - third_party/libbcrypt.patch | 78 ++++- third_party/libhydrogen | 1 - third_party/libhydrogen.patch | 144 ++++++++- third_party/libsodium | 1 - third_party/libsodium_cmake.patch | 70 +++++ tools/registrator/CMakeLists.txt | 11 +- tools/registrator/registrator_config.cpp | 2 +- 62 files changed, 553 insertions(+), 526 deletions(-) delete mode 100644 third_party/CMakeLists.libbcrypt delete mode 100644 third_party/CMakeLists.libhydrogen delete mode 160000 third_party/aethernet-numeric delete mode 160000 third_party/base-n delete mode 160000 third_party/c-ares delete mode 160000 third_party/date delete mode 160000 third_party/etl delete mode 160000 third_party/gcem delete mode 160000 third_party/ini.h delete mode 160000 third_party/libbcrypt delete mode 160000 third_party/libhydrogen delete mode 160000 third_party/libsodium create mode 100644 third_party/libsodium_cmake.patch diff --git a/.gitmodules b/.gitmodules index 91f55a6e..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,56 +0,0 @@ -[submodule "third_party/base-n"] - path = third_party/base-n - url = https://github.com/azawadzki/base-n.git - branch = master - ignore = dirty - -[submodule "third_party/libbcrypt"] - path = third_party/libbcrypt - url = https://github.com/rg3/libbcrypt.git - branch = master - ignore = dirty - -[submodule "third_party/libhydrogen"] - path = third_party/libhydrogen - url = https://github.com/jedisct1/libhydrogen.git - branch = master - ignore = dirty - -[submodule "third_party/libsodium"] - path = third_party/libsodium - url = https://github.com/jedisct1/libsodium.git - branch = master - ignore = dirty - -[submodule "third_party/c-ares"] - path = third_party/c-ares - url = https://github.com/c-ares/c-ares.git - branch = main - ignore = dirty - -[submodule "third_party/date"] - path = third_party/date - url = https://github.com/HowardHinnant/date.git - branch = master - ignore = dirty - -[submodule "third_party/ini.h"] - path = third_party/ini.h - url = https://github.com/giosali/ini.h - branch = main - ignore = dirty - -[submodule "third_party/etl"] - path = third_party/etl - url = https://github.com/ETLCPP/etl.git - branch = master - ignore = dirty - -[submodule "third_party/aethernet-numeric"] - path = third_party/aethernet-numeric - url = https://github.com/aethernetio/aethernet-numeric.git - branch = main -[submodule "third_party/gcem"] - path = third_party/gcem - url = https://github.com/aethernetio/gcem.git - branch = master diff --git a/aether/CMakeLists.txt b/aether/CMakeLists.txt index 4688271a..c0aff23e 100644 --- a/aether/CMakeLists.txt +++ b/aether/CMakeLists.txt @@ -19,6 +19,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(AE_PROJECT_VERSION "0.1.0") +project(aether VERSION ${AE_PROJECT_VERSION} LANGUAGES CXX C) + option(AE_NO_STRIP_ALL "Do not apply --strip_all, useful for bloaty and similar tools " Off) option(AE_DISTILLATION "Build aether in distillation mode" On) option(AE_FILTRATION "Build aether in filtration mode" Off) @@ -28,52 +30,92 @@ set(UTM_ID "0" CACHE STRING "User Tracking Measurement ID, must be a uint32 valu set(USER_CONFIG "" CACHE PATH "Path to user provided configuration header file") set(FS_INIT "" CACHE PATH "Path to user provided saved state header file") -list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/../cmake) -# include(repo_init) +message(STATUS "Cmake system name is ${CMAKE_SYSTEM_NAME}") -# ae_update_dependencies() +if(NOT CM_PLATFORM) + message(STATUS "Aether build for regular cmake project") + set(REGULAR_CMAKE_PROJECT On) +else() + message(STATUS "Aether build for CM_PLATFORM=${CM_PLATFORM}") + set(REGULAR_CMAKE_PROJECT Off) +endif() -include(CPM) +include(../cmake/CPM.cmake) # For using CPM.cmake projects with external package managers, such as conan or vcpkg, # setting the variable CPM_USE_LOCAL_PACKAGES will make CPM.cmake try to add a package through # find_package first, and add it from source if it doesn't succeed. -# To avoid extra downloads it is recommend to set the CPM_SOURCE_CACHE environmental variable # It is possible to override the consumer's dependency with the version by supplying # the CMake option CPM__SOURCE set to the absolute path of the local library. +# All dependencies must be EXCLUDE_FROM_ALL FALSE to make them install together with the aether. +# To avoid extra downloads it is recommend to set the CPM_SOURCE_CACHE environmental variable +# Also it required to used PATCHES +# +if (NOT CPM_SOURCE_CACHE) + set(CPM_SOURCE_CACHE "${CMAKE_CURRENT_BINARY_DIR}/cpm.cache") +endif() -CPMAddPackage("https://github.com/rg3/libbcrypt.git#master") -CPMAddPackage("https://github.com/jedisct1/libhydrogen.git#master") -CPMAddPackage("https://github.com/jedisct1/libsodium.git#master") -CPMAddPackage("https://github.com/aethernetio/gcem.git#master") -CPMAddPackage("https://github.com/aethernetio/aethernet-numeric.git#main") CPMAddPackage( - URI "https://github.com/ETLCPP/etl.git" + NAME libbcrypt + GIT_REPOSITORY "https://github.com/rg3/libbcrypt.git" + GIT_TAG "master" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/../third_party/libbcrypt.patch" + OPTIONS "ENABLE_INSTALL ${REGULAR_CMAKE_PROJECT}" + EXCLUDE_FROM_ALL FALSE +) +# TODO: libhydrogen newer than bbca575 is not compatible with used in aether server +CPMAddPackage( + NAME libhydrogen + GIT_REPOSITORY "https://github.com/jedisct1/libhydrogen.git" + GIT_TAG "bbca575" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/../third_party/libhydrogen.patch" + OPTIONS "ENABLE_INSTALL ${REGULAR_CMAKE_PROJECT}" + EXCLUDE_FROM_ALL FALSE +) +CPMAddPackage( + NAME libsodium + GIT_REPOSITORY "https://github.com/jedisct1/libsodium.git" + GIT_TAG "master" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/../third_party/libsodium.patch" "${CMAKE_CURRENT_LIST_DIR}/../third_party/libsodium_cmake.patch" + OPTIONS "ENABLE_INSTALL ${REGULAR_CMAKE_PROJECT}" + EXCLUDE_FROM_ALL FALSE +) +CPMAddPackage( + NAME gcem + GIT_REPOSITORY "https://github.com/aethernetio/gcem.git" + GIT_TAG "master" + EXCLUDE_FROM_ALL FALSE +) +# TODO: remove date +CPMAddPackage( + URI "https://github.com/HowardHinnant/date.git#master" + OPTIONS "ENABLE_DATE_INSTALL ${REGULAR_CMAKE_PROJECT}" + EXCLUDE_FROM_ALL FALSE +) +CPMAddPackage( + NAME numeric + GIT_REPOSITORY "https://github.com/aethernetio/aethernet-numeric.git" + GIT_TAG "main" + OPTIONS "AE_NUMERIC_INSTALL ${REGULAR_CMAKE_PROJECT}" + EXCLUDE_FROM_ALL FALSE +) +CPMAddPackage( + NAME etl + GIT_REPOSITORY "https://github.com/ETLCPP/etl.git" GIT_TAG "20.44.2" - OPTIONS "GIT_DIR_LOOKUP_POLICY ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR" + OPTIONS "GIT_DIR_LOOKUP_POLICY ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR" "ENABLE_INSTALL ${REGULAR_CMAKE_PROJECT}" + PATCHES "${CMAKE_CURRENT_LIST_DIR}/../third_party/etl.patch" + EXCLUDE_FROM_ALL FALSE ) CPMAddPackage( - URI "https://github.com/aethernetio/stdexec.git#main" - OPTIONS "STDEXEC_BUILD_EXAMPLES OFF" + NAME stdexec + GIT_REPOSITORY "https://github.com/aethernetio/stdexec.git" +# TODO: switch to main + GIT_TAG "2091-compilation-failed-with-fno-exception" + OPTIONS "STDEXEC_BUILD_EXAMPLES OFF" "STDEXEC_INSTALL ${REGULAR_CMAKE_PROJECT}" + EXCLUDE_FROM_ALL FALSE ) - - -# # list a common dependencies -# list(APPEND common_dependencies -# "../third_party/libbcrypt" -# "../third_party/libhydrogen" -# "../third_party/libsodium" -# "../third_party/gcem" -# "../third_party/etl" -# "../third_party/aethernet-numeric" -# "../third_party/stdexec" -# ) -# set(STDEXEC_BUILD_EXAMPLES Off) - -# for etl -# set(GIT_DIR_LOOKUP_POLICY ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) - list(APPEND aether_srcs "aether_app.cpp" "aether.cpp" @@ -86,32 +128,31 @@ list(APPEND aether_srcs "server_keys.cpp" "socket_initializer.cpp") -list(APPEND aether_c_api_srcs +list(APPEND aether_srcs "aether_c/c_uid.cpp" - "aether_c/aether_capi.cpp" -) + "aether_c/aether_capi.cpp") -list(APPEND types_srcs +list(APPEND aether_srcs "types/address.cpp") -list(APPEND events_srcs +list(APPEND aether_srcs "events/event_list.cpp" "events/event_deleter.cpp" "events/event_subscription.cpp" "events/multi_subscription.cpp") -list(APPEND poller_srcs +list(APPEND aether_srcs "poller/epoll_poller.cpp" "poller/kqueue_poller.cpp" "poller/freertos_poller.cpp" "poller/win_poller.cpp") -list(APPEND dns_srcs +list(APPEND aether_srcs "dns/dns_resolve.cpp" "dns/dns_c_ares.cpp" "dns/esp32_dns_resolve.cpp") -list(APPEND obj_srcs +list(APPEND aether_srcs "obj/obj.cpp" "obj/domain.cpp" "obj/obj_id.cpp" @@ -119,13 +160,13 @@ list(APPEND obj_srcs "obj/obj_ptr_base.cpp" ) -list(APPEND ptr_srcs +list(APPEND aether_srcs "ptr/ptr.cpp" "ptr/ptr_view.cpp" "ptr/ref_tree.cpp" ) -list(APPEND actions_srcs +list(APPEND aether_srcs "ae_actions/get_client_cloud.cpp" "ae_actions/get_servers.cpp" "ae_actions/ping.cpp" @@ -135,7 +176,7 @@ list(APPEND actions_srcs "ae_actions/time_sync.cpp" ) -list(APPEND registration_srcs +list(APPEND aether_srcs "registration/api/client_reg_api_safe.cpp" "registration/api/client_reg_api_unsafe.cpp" "registration/api/global_reg_client_api.cpp" @@ -147,11 +188,11 @@ list(APPEND registration_srcs "registration/registration_crypto_provider.cpp" "registration/root_server_select_stream.cpp") -list(APPEND uap_srcs +list(APPEND aether_srcs "uap/uap.cpp" ) -list(APPEND adapters_srcs +list(APPEND aether_srcs "adapters/adapter.cpp" "adapters/wifi_adapter.cpp" "adapters/ethernet.cpp" @@ -162,33 +203,33 @@ list(APPEND adapters_srcs "adapters/parent_wifi.cpp" ) -list(APPEND access_points_srcs +list(APPEND aether_srcs "access_points/access_point.cpp" "access_points/ethernet_access_point.cpp" "access_points/wifi_access_point.cpp" "access_points/lora_module_access_point.cpp" "access_points/modem_access_point.cpp") -list(APPEND modems_srcs +list(APPEND aether_srcs "modems/modem_factory.cpp" "modems/bg95_at_modem.cpp" "modems/sim7070_at_modem.cpp" "modems/thingy91x_at_modem.cpp") -list(APPEND lora_modules_srcs +list(APPEND aether_srcs "lora_modules/dx_smart_lr02_lm.cpp" "lora_modules/ebyte_e22_lm.cpp" "lora_modules/lora_module_factory.cpp") -list(APPEND gateway_api_srcs +list(APPEND aether_srcs "gateway_api/gateway_api.cpp") -list(APPEND wifi_srcs +list(APPEND aether_srcs "wifi/wifi_driver_factory.cpp" "wifi/esp_wifi_driver.cpp" ) -list(APPEND serial_ports_srcs +list(APPEND aether_srcs "serial_ports/at_support/at_buffer.cpp" "serial_ports/at_support/at_dispatcher.cpp" "serial_ports/at_support/at_listener.cpp" @@ -199,7 +240,7 @@ list(APPEND serial_ports_srcs "serial_ports/unix_serial_port.cpp" ) -list(APPEND transport_srcs +list(APPEND aether_srcs "transport/system_sockets/sockets/get_sock_addr.cpp" "transport/system_sockets/sockets/lwip_cb_tcp_socket.cpp" "transport/system_sockets/sockets/lwip_cb_udp_socket.cpp" @@ -221,23 +262,23 @@ list(APPEND transport_srcs "transport/gateway/gateway_transport.cpp" ) -list(APPEND stream_api_src +list(APPEND aether_srcs "stream_api/sized_packet_gate.cpp" "stream_api/stream_api.cpp" ) -list(APPEND write_action_srcs +list(APPEND aether_srcs "write_action/buffer_write.cpp" ) -list(APPEND api_protocol_srcs +list(APPEND aether_srcs "api_protocol/protocol_context.cpp" "api_protocol/api_pack_parser.cpp" "api_protocol/child_data.cpp" "api_protocol/return_result_api.cpp" ) -list(APPEND crypto_srcs +list(APPEND aether_srcs "crypto/crypto_nonce.cpp" "crypto/signed_key.cpp" "crypto/key_gen.cpp" @@ -249,35 +290,35 @@ list(APPEND crypto_srcs "crypto/hydrogen/hydro_sync_crypto_provider.cpp" ) -list(APPEND work_cloud_api_srcs +list(APPEND aether_srcs "work_cloud_api/work_server_api/login_api.cpp" "work_cloud_api/work_server_api/authorized_api.cpp" "work_cloud_api/client_api/client_api_unsafe.cpp" "work_cloud_api/client_api/client_api_safe.cpp") -list(APPEND cloud_connections_srcs +list(APPEND aether_srcs "cloud_connections/cloud_server_connection.cpp" "cloud_connections/cloud_server_connections.cpp" "cloud_connections/cloud_subscription.cpp" "cloud_connections/cloud_request.cpp") -list(APPEND server_connections_srcs +list(APPEND aether_srcs "server_connections/client_server_connection.cpp" "server_connections/channel_connection.cpp" "server_connections/server_connection.cpp") -list(APPEND connection_manager_srcs +list(APPEND aether_srcs "connection_manager/client_connection_manager.cpp" "connection_manager/client_cloud_manager.cpp" "connection_manager/server_connection_manager.cpp") -list(APPEND client_messages_srcs +list(APPEND aether_srcs "client_messages/p2p_message_stream.cpp" "client_messages/p2p_message_stream_manager.cpp" "client_messages/p2p_safe_message_stream.cpp") -list(APPEND domain_storage_srcs +list(APPEND aether_srcs "domain_storage/domain_storage_factory.cpp" "domain_storage/registrar_domain_storage.cpp" "domain_storage/static_domain_storage.cpp" @@ -286,7 +327,7 @@ list(APPEND domain_storage_srcs "domain_storage/file_system_std_storage.cpp" "domain_storage/sync_domain_storage.cpp") -list(APPEND channels_srcs +list(APPEND aether_srcs "channels/channel_statistics.cpp" "channels/channel.cpp" "channels/ethernet_transport_factory.cpp" @@ -295,147 +336,69 @@ list(APPEND channels_srcs "channels/lora_module_channel.cpp" "channels/modem_channel.cpp") -list(APPEND tele_srcs +list(APPEND aether_srcs "tele/tele_init.cpp" "tele/traps/io_stream_traps.cpp" "tele/traps/statistics_trap.cpp" "tele/traps/tele_statistics.cpp") -message(STATUS "Cmake system name is ${CMAKE_SYSTEM_NAME}") +add_library(aether STATIC ${aether_srcs}) -if(NOT CM_PLATFORM) - message(STATUS "Aether build for regular cmake project") - set(REGULAR_CMAKE_PROJECT On) -else() - message(STATUS "Aether build for CM_PLATFORM=${CM_PLATFORM}") -endif() +set(TARGET_NAME "${PROJECT_NAME}") -if(REGULAR_CMAKE_PROJECT) - project(aether VERSION ${AE_PROJECT_VERSION} LANGUAGES CXX C) +# https://stackoverflow.com/questions/25676277/cmake-target-include-directories-prints-an-error-when-i-try-to-add-the-source +target_include_directories(${PROJECT_NAME} PUBLIC + $ + $ +) +target_link_libraries(${PROJECT_NAME} PUBLIC + bcrypt + sodium + hydrogen + gcem + etl + stdexec + numeric + date) +if(REGULAR_CMAKE_PROJECT) + # for desktop projects add c-ares CPMAddPackage( - URI "https://github.com/c-ares/c-ares.git#main" + NAME c-ares + GIT_REPOSITORY "https://github.com/c-ares/c-ares.git" + GIT_TAG "main" OPTIONS "CARES_BUILD_TOOLS OFF" "CARES_STATIC ON" "CARES_SHARED OFF" + "CARES_INSTALL ${REGULAR_CMAKE_PROJECT}" ) - # set(CARES_BUILD_TOOLS OFF CACHE BOOL "" FORCE) - # set(CARES_STATIC ON CACHE BOOL "" FORCE) - # set(CARES_SHARED OFF CACHE BOOL "" FORCE) - # list(APPEND common_dependencies "../third_party/c-ares") - - foreach(dep ${common_dependencies}) - get_filename_component(DEP_NAME ${dep} NAME) - add_subdirectory(${dep} "${CMAKE_CURRENT_BINARY_DIR}/${DEP_NAME}") - endforeach() - - add_library(aether STATIC ${aether_srcs} - ${aether_c_api_srcs} - ${types_srcs} - ${events_srcs} - ${poller_srcs} - ${dns_srcs} - ${obj_srcs} - ${ptr_srcs} - ${actions_srcs} - ${transport_srcs} - ${stream_api_src} - ${write_action_srcs} - ${uap_srcs} - ${adapters_srcs} - ${access_points_srcs} - ${modems_srcs} - ${lora_modules_srcs} - ${gateway_api_srcs} - ${wifi_srcs} - ${serial_ports_srcs} - ${api_protocol_srcs} - ${crypto_srcs} - ${work_cloud_api_srcs} - ${registration_srcs} - ${client_messages_srcs} - ${cloud_connections_srcs} - ${server_connections_srcs} - ${connection_manager_srcs} - ${domain_storage_srcs} - ${channels_srcs} - ${tele_srcs} - ) - - # https://stackoverflow.com/questions/25676277/cmake-target-include-directories-prints-an-error-when-i-try-to-add-the-source - target_include_directories(${PROJECT_NAME} PUBLIC - $ - $ - ) - target_link_libraries(${PROJECT_NAME} PUBLIC - bcrypt - sodium - hydrogen - gcem - etl - stdexec) target_link_libraries(${PROJECT_NAME} PRIVATE c-ares ) +endif() - set(TARGET_NAME "${PROJECT_NAME}") -else() - idf_build_get_property(CM_PLATFORM CM_PLATFORM) - if(CM_PLATFORM STREQUAL "ESP32") - #ESP32 CMake - set(include_dirs "../") - - idf_component_register( SRCS - ${aether_srcs} - ${aether_c_api_srcs} - ${types_srcs} - ${events_srcs} - ${poller_srcs} - ${dns_srcs} - ${obj_srcs} - ${ptr_srcs} - ${actions_srcs} - ${uap_srcs} - ${adapters_srcs} - ${access_points_srcs} - ${modems_srcs} - ${lora_modules_srcs} - ${gateway_api_srcs} - ${wifi_srcs} - ${serial_ports_srcs} - ${transport_srcs} - ${stream_api_src} - ${write_action_srcs} - ${api_protocol_srcs} - ${crypto_srcs} - ${work_cloud_api_srcs} - ${registration_srcs} - ${client_messages_srcs} - ${cloud_connections_srcs} - ${server_connections_srcs} - ${connection_manager_srcs} - ${domain_storage_srcs} - ${channels_srcs} - ${tele_srcs} - INCLUDE_DIRS ${include_dirs} - REQUIRES esp_wifi nvs_flash spiffs esp_driver_uart) - - set(TARGET_NAME "${COMPONENT_LIB}") - - foreach(dep ${common_dependencies}) - get_filename_component(DEP_NAME ${dep} NAME) - add_subdirectory(${dep} ${DEP_NAME}) - endforeach() - - target_link_libraries(${TARGET_NAME} PUBLIC - bcrypt - sodium - hydrogen - gcem - etl - stdexec) - else() - #ERROR - message(SEND_ERROR "You must specify the CMAKE version!") - endif() +if(ESP_PLATFORM) + # aether requires some esp idf components to be requested + # they must exists as cmake targets + list(APPEND idf_components + idf::esp_wifi + idf::esp_netif + idf::nvs_flash + idf::spiffs + idf::esp_driver_uart) + + # test if they exists + foreach(c ${idf_components}) + if (NOT TARGET ${c}) + # component not found, print required components + foreach(cc ${idf_components}) + string(REPLACE "idf::" "" cc_name ${cc}) + set(required_components "${required_components} ${cc_name}") + endforeach() + message(FATAL_ERROR "Component ${c} not found request it by \n\tidf_component_register(REQUIRES ${required_components})") + break() + endif() + endforeach() + + target_link_libraries(${PROJECT_NAME} PUBLIC ${idf_components}) endif() if (CMAKE_SYSTEM_NAME MATCHES ".*BSD.*" ) @@ -579,18 +542,21 @@ if(AE_BUILD_TESTS) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../tests ${CMAKE_BINARY_DIR}/tests) endif() - -if(REGULAR_CMAKE_PROJECT AND NOT AE_BUILD_TESTS) - ## Target installation - # install(TARGETS ${TARGET_NAME} - # EXPORT ${TARGET_NAME}Targets - # ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - # LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - # PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${TARGET_NAME} - # COMPONENT library) - - ## Target's cmake files: targets export - #install(EXPORT ${TARGET_NAME}Targets - # NAMESPACE ${TARGET_NAME}:: - # DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${TARGET_NAME}) +if(REGULAR_CMAKE_PROJECT) + include(CMakePackageConfigHelpers) + include(GNUInstallDirs) + + # Target installation + install(TARGETS ${TARGET_NAME} + EXPORT ${TARGET_NAME}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${TARGET_NAME}) + + install(DIRECTORY ../${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ FILES_MATCHING PATTERN "*.h") + + # Target's cmake files: targets export + install(EXPORT ${TARGET_NAME}Targets + NAMESPACE ${TARGET_NAME}:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${TARGET_NAME}) endif() diff --git a/aether/actions/action_pool.h b/aether/actions/action_pool.h index 899baadd..9b047ca8 100644 --- a/aether/actions/action_pool.h +++ b/aether/actions/action_pool.h @@ -24,8 +24,8 @@ DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/etl/include/etl/pool.h" -#include "third_party/etl/include/etl/variant_pool.h" +#include +#include DISABLE_WARNING_POP() #include "aether/actions/action.h" diff --git a/aether/ae_actions/ping.h b/aether/ae_actions/ping.h index 0e2310ee..fec3b15c 100644 --- a/aether/ae_actions/ping.h +++ b/aether/ae_actions/ping.h @@ -24,7 +24,7 @@ DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/etl/include/etl/circular_buffer.h" +#include DISABLE_WARNING_POP() #include "aether/common.h" diff --git a/aether/api_protocol/api_message.h b/aether/api_protocol/api_message.h index dd2afd4a..abc44505 100644 --- a/aether/api_protocol/api_message.h +++ b/aether/api_protocol/api_message.h @@ -21,7 +21,7 @@ #include #include -#include "third_party/aethernet-numeric/numeric/tiered_int.h" +#include #include "aether/mstream.h" #include "aether/mstream_buffers.h" diff --git a/aether/api_protocol/api_method.h b/aether/api_protocol/api_method.h index 973819f4..a252c25f 100644 --- a/aether/api_protocol/api_method.h +++ b/aether/api_protocol/api_method.h @@ -21,7 +21,7 @@ DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/etl/include/etl/pool.h" +#include DISABLE_WARNING_POP() #include "aether/api_protocol/api_message.h" diff --git a/aether/crypto/crypto_nonce.cpp b/aether/crypto/crypto_nonce.cpp index f6fdd787..9639e87e 100644 --- a/aether/crypto/crypto_nonce.cpp +++ b/aether/crypto/crypto_nonce.cpp @@ -17,10 +17,10 @@ #include "aether/crypto/crypto_nonce.h" #if AE_CRYPTO_SYNC == AE_CHACHA20_POLY1305 -# include "third_party/libsodium/src/libsodium/include/sodium/randombytes.h" +# include #endif #if AE_CRYPTO_SYNC == AE_HYDRO_CRYPTO_SK -# include "third_party/libhydrogen/hydrogen.h" +# include #endif namespace ae { diff --git a/aether/crypto/crypto_nonce.h b/aether/crypto/crypto_nonce.h index 04a77ad1..45a3fc15 100644 --- a/aether/crypto/crypto_nonce.h +++ b/aether/crypto/crypto_nonce.h @@ -24,9 +24,8 @@ #include "aether/reflect/reflect.h" #if AE_CRYPTO_SYNC == AE_CHACHA20_POLY1305 -// too long include string -# include "third_party/libsodium/src/libsodium/include/sodium/\ -crypto_aead_chacha20poly1305.h" // " this helps ide to parse following quotes + +# include #endif diff --git a/aether/crypto/key.h b/aether/crypto/key.h index 9fad63f2..e5e5e2ca 100644 --- a/aether/crypto/key.h +++ b/aether/crypto/key.h @@ -30,21 +30,20 @@ # include # if AE_CRYPTO_ASYNC == AE_SODIUM_BOX_SEAL -# include "third_party/libsodium/src/libsodium/include/sodium/crypto_box.h" +# include # endif # if AE_SIGNATURE == AE_ED25519 -# include "third_party/libsodium/src/libsodium/include/sodium/crypto_sign.h" +# include # endif # if AE_CRYPTO_SYNC == AE_CHACHA20_POLY1305 -# include "third_party/libsodium/src/libsodium/include/sodium/\ -crypto_aead_chacha20poly1305.h" //" +# include # endif # if AE_CRYPTO_SYNC == AE_HYDRO_CRYPTO_SK || \ AE_CRYPTO_ASYNC == AE_HYDRO_CRYPTO_PK || \ AE_SIGNATURE == AE_HYDRO_SIGNATURE -# include "third_party/libhydrogen/hydrogen.h" +# include # endif # include "aether/reflect/reflect.h" diff --git a/aether/crypto/key_gen.cpp b/aether/crypto/key_gen.cpp index 1d7b0fae..3e6102af 100644 --- a/aether/crypto/key_gen.cpp +++ b/aether/crypto/key_gen.cpp @@ -24,22 +24,21 @@ #include "aether/crypto/crypto_definitions.h" #if AE_CRYPTO_SYNC == AE_CHACHA20_POLY1305 -# include "third_party/libsodium/src/libsodium/include/sodium/\ -crypto_aead_chacha20poly1305.h" //" +# include #endif #if AE_CRYPTO_ASYNC == AE_SODIUM_BOX_SEAL -# include "third_party/libsodium/src/libsodium/include/sodium/crypto_box.h" +# include #endif #if AE_KDF == AE_SODIUM_KDF -# include "third_party/libsodium/src/libsodium/include/sodium/crypto_kdf.h" +# include #endif #if AE_SIGNATURE == AE_HYDRO_SIGNATURE || \ AE_CRYPTO_SYNC == AE_HYDRO_CRYPTO_SK || \ AE_CRYPTO_ASYNC == AE_HYDRO_CRYPTO_PK || AE_KDF == AE_HYDRO_KDF -# include "third_party/libhydrogen/hydrogen.h" +# include #endif namespace ae { diff --git a/aether/crypto/sign.h b/aether/crypto/sign.h index 064c2bd1..03ac77db 100644 --- a/aether/crypto/sign.h +++ b/aether/crypto/sign.h @@ -28,9 +28,9 @@ # include # if AE_SIGNATURE == AE_ED25519 -# include "third_party/libsodium/src/libsodium/include/sodium/crypto_sign.h" +# include # elif AE_SIGNATURE == AE_HYDRO_SIGNATURE -# include "third_party/libhydrogen/hydrogen.h" +# include # endif # include "aether/reflect/reflect.h" diff --git a/aether/crypto/signed_key.cpp b/aether/crypto/signed_key.cpp index ffa4eeb5..9d5ba0cb 100644 --- a/aether/crypto/signed_key.cpp +++ b/aether/crypto/signed_key.cpp @@ -19,11 +19,11 @@ #include "aether/crypto/crypto_definitions.h" #if AE_SIGNATURE == AE_ED25519 -# include "third_party/libsodium/src/libsodium/include/sodium/crypto_sign.h" +# include #endif #if AE_SIGNATURE == AE_HYDRO_SIGNATURE -# include "third_party/libhydrogen/hydrogen.h" +# include #endif namespace ae { diff --git a/aether/executors/any_sender.h b/aether/executors/any_sender.h index 2bab3f26..56169d14 100644 --- a/aether/executors/any_sender.h +++ b/aether/executors/any_sender.h @@ -18,21 +18,21 @@ #include -#include "third_party/stdexec/include/exec/any_sender_of.hpp" +#include namespace ae::ex { // provide the list of signatures in form // set_value_t(type...), set_error_t(type) // !Note set_error_t must take one type, while set_value_t may not have any template -using AnySender = typename experimental::execution::any_receiver_ref< - stdexec::completion_signatures - // ~['_']~ - >::template any_sender<>; +using AnySender = experimental::execution::any_sender< + experimental::execution::any_receiver>>; +// ~['_']~ } // namespace ae::ex #endif // AETHER_EXECUTORS_ANY_SENDER_H_ diff --git a/aether/executors/any_waiter.h b/aether/executors/any_waiter.h index 8dcd1700..91b1a32e 100644 --- a/aether/executors/any_waiter.h +++ b/aether/executors/any_waiter.h @@ -23,7 +23,7 @@ #include #include -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include #include "aether/types/result.h" #include "aether/meta/ignore_t.h" diff --git a/aether/executors/async_waiter.h b/aether/executors/async_waiter.h index c4aab8a0..d9aa19f7 100644 --- a/aether/executors/async_waiter.h +++ b/aether/executors/async_waiter.h @@ -26,7 +26,7 @@ // IWYU pragma: begin_exports DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include DISABLE_WARNING_POP() #include "aether/types/result.h" diff --git a/aether/executors/executors.h b/aether/executors/executors.h index 66168990..c95adafe 100644 --- a/aether/executors/executors.h +++ b/aether/executors/executors.h @@ -22,9 +22,9 @@ // IWYU pragma: begin_exports DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include -#include "third_party/stdexec/include/exec/variant_sender.hpp" +#include DISABLE_WARNING_POP() #include "aether/executors/for_range.h" diff --git a/aether/executors/for_range.h b/aether/executors/for_range.h index 5425e95a..ae522989 100644 --- a/aether/executors/for_range.h +++ b/aether/executors/for_range.h @@ -21,7 +21,7 @@ #include #include -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include #include "aether/types/iterator.h" #include "aether/meta/type_list.h" diff --git a/aether/executors/make_sender.h b/aether/executors/make_sender.h index 0a36d686..82b89862 100644 --- a/aether/executors/make_sender.h +++ b/aether/executors/make_sender.h @@ -19,8 +19,8 @@ #include -#include "third_party/stdexec/include/exec/create.hpp" -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include +#include namespace ae::ex { namespace make_sender_internal { diff --git a/aether/executors/scheduler_on_tasks.h b/aether/executors/scheduler_on_tasks.h index 90b63fa9..38adec48 100644 --- a/aether/executors/scheduler_on_tasks.h +++ b/aether/executors/scheduler_on_tasks.h @@ -17,7 +17,7 @@ #ifndef AETHER_EXECUTORS_SCHEDULER_ON_TASKS_H_ #define AETHER_EXECUTORS_SCHEDULER_ON_TASKS_H_ -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include #include "aether/executors/async_context.h" diff --git a/aether/executors/sync_waiter.h b/aether/executors/sync_waiter.h index 5dbd7d80..ed407971 100644 --- a/aether/executors/sync_waiter.h +++ b/aether/executors/sync_waiter.h @@ -24,7 +24,7 @@ // IWYU pragma: begin_exports DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include DISABLE_WARNING_POP() #include "aether/types/result.h" diff --git a/aether/executors/waiter_traits.h b/aether/executors/waiter_traits.h index 0e6554fc..d31a2262 100644 --- a/aether/executors/waiter_traits.h +++ b/aether/executors/waiter_traits.h @@ -26,7 +26,7 @@ // IWYU pragma: begin_exports DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include DISABLE_WARNING_POP() #include "aether/meta/ignore_t.h" diff --git a/aether/executors/with_timeout.h b/aether/executors/with_timeout.h index c1162f86..9e04ea59 100644 --- a/aether/executors/with_timeout.h +++ b/aether/executors/with_timeout.h @@ -20,7 +20,7 @@ #include #include -#include "third_party/stdexec/include/stdexec/execution.hpp" +#include #include "aether/executors/async_context.h" #include "aether/tasks/details/task_subsctiption.h" diff --git a/aether/format/format_time.h b/aether/format/format_time.h index 3650e767..2429d3de 100644 --- a/aether/format/format_time.h +++ b/aether/format/format_time.h @@ -23,7 +23,7 @@ #include "aether/clock.h" #include "aether/format/formatter.h" -#include "third_party/date/include/date/date.h" +#include namespace ae { /** diff --git a/aether/registration/proof_of_work.cpp b/aether/registration/proof_of_work.cpp index 1714baf2..534c7a27 100644 --- a/aether/registration/proof_of_work.cpp +++ b/aether/registration/proof_of_work.cpp @@ -21,7 +21,7 @@ # include # include -# include "third_party/libbcrypt/bcrypt.h" +# include # include "aether/crc.h" diff --git a/aether/server_keys.h b/aether/server_keys.h index caf6b29a..2913dda6 100644 --- a/aether/server_keys.h +++ b/aether/server_keys.h @@ -20,7 +20,7 @@ #include #include -#include "third_party/aethernet-numeric/numeric/tiered_int.h" +#include #include "aether/crypto/key.h" #include "aether/types/server_id.h" diff --git a/aether/tasks/details/task_manager.h b/aether/tasks/details/task_manager.h index aace3af0..f2ccc20d 100644 --- a/aether/tasks/details/task_manager.h +++ b/aether/tasks/details/task_manager.h @@ -25,7 +25,7 @@ #include "aether/tasks/details/task_queues.h" #include "aether/tasks/details/generic_task.h" -#include "third_party/etl/include/etl/generic_pool.h" +#include namespace ae { namespace task_manager_internal { diff --git a/aether/tasks/details/task_queues.h b/aether/tasks/details/task_queues.h index 9c395471..dc62081d 100644 --- a/aether/tasks/details/task_queues.h +++ b/aether/tasks/details/task_queues.h @@ -26,7 +26,7 @@ #include "aether/warning_disable.h" DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/etl/include/etl/vector.h" +#include DISABLE_WARNING_POP() namespace ae { diff --git a/aether/tele/traps/statistics_trap.h b/aether/tele/traps/statistics_trap.h index 54e56f2b..bd6bc7c4 100644 --- a/aether/tele/traps/statistics_trap.h +++ b/aether/tele/traps/statistics_trap.h @@ -25,7 +25,7 @@ #include #include -#include "third_party/aethernet-numeric/numeric/tiered_int.h" +#include #include "aether/clock.h" #include "aether/config.h" diff --git a/aether/transport/data_packet_collector.h b/aether/transport/data_packet_collector.h index 4eeec1e3..d4c71411 100644 --- a/aether/transport/data_packet_collector.h +++ b/aether/transport/data_packet_collector.h @@ -23,7 +23,7 @@ #include #include -#include "third_party/aethernet-numeric/numeric/tiered_int.h" +#include #include "aether/memory_buffer.h" #include "aether/types/data_buffer.h" diff --git a/aether/transport/packet_queue_manager.h b/aether/transport/packet_queue_manager.h index 197fabab..5ccd46a4 100644 --- a/aether/transport/packet_queue_manager.h +++ b/aether/transport/packet_queue_manager.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include "aether/ae_context.h" #include "aether/transport/packet_send_action.h" diff --git a/aether/types/statistic_counter.h b/aether/types/statistic_counter.h index 67864494..15be1e3a 100644 --- a/aether/types/statistic_counter.h +++ b/aether/types/statistic_counter.h @@ -27,7 +27,7 @@ DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/etl/include/etl/circular_buffer.h" +#include DISABLE_WARNING_POP() #include "aether/common.h" diff --git a/aether/write_action/buffer_write.h b/aether/write_action/buffer_write.h index c6d59d80..1005b419 100644 --- a/aether/write_action/buffer_write.h +++ b/aether/write_action/buffer_write.h @@ -21,7 +21,7 @@ DISABLE_WARNING_PUSH() IGNORE_IMPLICIT_CONVERSION() -#include "third_party/etl/include/etl/circular_buffer.h" +#include DISABLE_WARNING_POP() #include "aether/ae_context.h" diff --git a/examples/cloud/CMakeLists.txt b/examples/cloud/CMakeLists.txt index db6d974e..57b46bff 100644 --- a/examples/cloud/CMakeLists.txt +++ b/examples/cloud/CMakeLists.txt @@ -28,12 +28,6 @@ if(NOT CM_PLATFORM) add_executable(${PROJECT_NAME} ${src_list}) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(${PROJECT_NAME} PRIVATE aether) - - include(GNUInstallDirs) - install(TARGETS ${PROJECT_NAME} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - else() idf_build_get_property(CM_PLATFORM CM_PLATFORM) if(CM_PLATFORM STREQUAL "ESP32") diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a3539cea..f5e4040f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,28 +20,11 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/run) set(ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/..") +include(../cmake/CPM.cmake) + # enable doubles in unity tests add_compile_definitions("UNITY_INCLUDE_DOUBLE") - -#dependancies -if (NOT TARGET aether) - add_subdirectory("${ROOT_DIR}/aether" "aether") -endif() -if (NOT TARGET bcrypt) - add_subdirectory("${ROOT_DIR}/third_party/libbcrypt" "libbcrypt") -endif() -if (NOT TARGET hydrogen) - add_subdirectory("${ROOT_DIR}/third_party/libhydrogen" "libhydrogen") -endif() -if (NOT TARGET sodium) - add_subdirectory("${ROOT_DIR}/third_party/libsodium" "libsodium") -endif() -if (NOT TARGET unity) - add_subdirectory("${ROOT_DIR}/third_party/Unity" "libUnity") -endif() -if (NOT TARGET gcem) - add_subdirectory("${ROOT_DIR}/third_party/gcem" "gcem") -endif() +CPMAddPackage("https://github.com/ThrowTheSwitch/Unity.git#master") include(inline_tests/inline_tests.cmake) add_subdirectory(inline_tests) diff --git a/tests/inline_tests/CMakeLists.txt b/tests/inline_tests/CMakeLists.txt index 0c6f4ccc..a91a3127 100644 --- a/tests/inline_tests/CMakeLists.txt +++ b/tests/inline_tests/CMakeLists.txt @@ -20,3 +20,16 @@ add_library(inline_tests INTERFACE) target_include_directories(inline_tests INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(inline_tests INTERFACE unity) target_compile_definitions(inline_tests INTERFACE "-DAE_TESTS=1") + +# Target installation +install(TARGETS inline_tests + EXPORT inline_tests_Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${TARGET_NAME} + COMPONENT library) + +# Target's cmake files: targets export +install(EXPORT inline_tests_Targets + NAMESPACE inline_tests:: + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/inline_tests) diff --git a/tests/test-actions/CMakeLists.txt b/tests/test-actions/CMakeLists.txt index eb2a6a9c..fcdd5df9 100644 --- a/tests/test-actions/CMakeLists.txt +++ b/tests/test-actions/CMakeLists.txt @@ -34,7 +34,7 @@ if(NOT CM_PLATFORM) target_sources(${PROJECT_NAME} PRIVATE ${action_srcs} ${test_srcs}) # for aether target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity) + target_link_libraries(${PROJECT_NAME} PRIVATE unity etl) add_test(NAME ${PROJECT_NAME} COMMAND $) else() diff --git a/tests/test-events/CMakeLists.txt b/tests/test-events/CMakeLists.txt index c794c548..961a09f9 100644 --- a/tests/test-events/CMakeLists.txt +++ b/tests/test-events/CMakeLists.txt @@ -31,7 +31,7 @@ if(NOT CM_PLATFORM) add_executable(${PROJECT_NAME}) target_sources(${PROJECT_NAME} PRIVATE ${test_events_srcs}) target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity) + target_link_libraries(${PROJECT_NAME} PRIVATE unity etl) add_test(NAME ${PROJECT_NAME} COMMAND $) else() diff --git a/tests/test-format/CMakeLists.txt b/tests/test-format/CMakeLists.txt index 29f135c7..8982f42d 100644 --- a/tests/test-format/CMakeLists.txt +++ b/tests/test-format/CMakeLists.txt @@ -28,7 +28,7 @@ if(NOT CM_PLATFORM) target_sources(${PROJECT_NAME} PRIVATE ${test_srcs}) # for aether target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity) + target_link_libraries(${PROJECT_NAME} PRIVATE unity date) add_test(NAME ${PROJECT_NAME} COMMAND $) else() diff --git a/tests/test-object-system/CMakeLists.txt b/tests/test-object-system/CMakeLists.txt index e3248da1..f588fd44 100644 --- a/tests/test-object-system/CMakeLists.txt +++ b/tests/test-object-system/CMakeLists.txt @@ -52,7 +52,7 @@ if(NOT CM_PLATFORM) # for aether target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity ) + target_link_libraries(${PROJECT_NAME} PRIVATE unity date etl numeric) target_compile_definitions(${PROJECT_NAME} PRIVATE "AE_DISTILLATION=1") target_compile_definitions(${PROJECT_NAME} PRIVATE "AE_PROJECT_VERSION=\"0.0.0\"") diff --git a/tests/test-tasks/CMakeLists.txt b/tests/test-tasks/CMakeLists.txt index 3a90a433..7bf7dbf7 100644 --- a/tests/test-tasks/CMakeLists.txt +++ b/tests/test-tasks/CMakeLists.txt @@ -29,7 +29,7 @@ if(NOT CM_PLATFORM) target_sources(${PROJECT_NAME} PRIVATE ${test_srcs}) # for aether target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity) + target_link_libraries(${PROJECT_NAME} PRIVATE unity etl) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(${PROJECT_NAME} PUBLIC /Zc:preprocessor) endif() diff --git a/tests/test-tasks/test-task-queues.cpp b/tests/test-tasks/test-task-queues.cpp index 386c71f6..c3272f01 100644 --- a/tests/test-tasks/test-task-queues.cpp +++ b/tests/test-tasks/test-task-queues.cpp @@ -19,9 +19,9 @@ #include #include -#include "aether/tasks/details/task_queues.h" +#include -#include "third_party/etl/include/etl/generic_pool.h" +#include "aether/tasks/details/task_queues.h" namespace ae::test_task_queues { using namespace std::chrono_literals; diff --git a/tests/test-tele/CMakeLists.txt b/tests/test-tele/CMakeLists.txt index 6bf8ddcf..f61bb711 100644 --- a/tests/test-tele/CMakeLists.txt +++ b/tests/test-tele/CMakeLists.txt @@ -33,7 +33,7 @@ if(NOT CM_PLATFORM) target_sources(${PROJECT_NAME} PRIVATE ${test_tele_srcs} ${test_srcs}) # for aether target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity) + target_link_libraries(${PROJECT_NAME} PRIVATE unity date numeric) target_compile_definitions(${PROJECT_NAME} PRIVATE AE_PROJECT_VERSION="0.0.0") add_test(NAME ${PROJECT_NAME} COMMAND $) diff --git a/tests/test-types/CMakeLists.txt b/tests/test-types/CMakeLists.txt index 7026a831..ba27a266 100644 --- a/tests/test-types/CMakeLists.txt +++ b/tests/test-types/CMakeLists.txt @@ -37,7 +37,7 @@ if(NOT CM_PLATFORM) target_sources(${PROJECT_NAME} PRIVATE ${test_srcs}) # for aether target_include_directories(${PROJECT_NAME} PRIVATE ${ROOT_DIR}) - target_link_libraries(${PROJECT_NAME} PRIVATE unity gcem) + target_link_libraries(${PROJECT_NAME} PRIVATE unity gcem etl date numeric) if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") target_compile_options(${PROJECT_NAME} PUBLIC /Zc:preprocessor) endif() diff --git a/tests/third_party_tests/CMakeLists.txt b/tests/third_party_tests/CMakeLists.txt index 9a77651a..9821f809 100644 --- a/tests/third_party_tests/CMakeLists.txt +++ b/tests/third_party_tests/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required( VERSION 3.16 ) -add_subdirectory(${ROOT_DIR}/third_party/libbcrypt_unit_tests third_party_tests/libbcrypt_unit_tests) -add_subdirectory(${ROOT_DIR}/third_party/libhydrogen_unit_tests third_party_tests/libhydrogen_unit_tests) -add_subdirectory(${ROOT_DIR}/third_party/libsodium_unit_tests third_party_tests/libsodium_unit_tests) +# add_subdirectory(${ROOT_DIR}/third_party/libbcrypt_unit_tests third_party_tests/libbcrypt_unit_tests) +# add_subdirectory(${ROOT_DIR}/third_party/libhydrogen_unit_tests third_party_tests/libhydrogen_unit_tests) +# add_subdirectory(${ROOT_DIR}/third_party/libsodium_unit_tests third_party_tests/libsodium_unit_tests) diff --git a/third_party/CMakeLists.libbcrypt b/third_party/CMakeLists.libbcrypt deleted file mode 100644 index 04daf486..00000000 --- a/third_party/CMakeLists.libbcrypt +++ /dev/null @@ -1,83 +0,0 @@ -cmake_minimum_required(VERSION 3.16.0) - -list(APPEND libbcryp_srcs - bcrypt.c) - -list(APPEND crypt_blowfish_srcs - crypt_blowfish/crypt_blowfish.c - crypt_blowfish/crypt_gensalt.c - crypt_blowfish/wrapper.c) - -if(NOT CM_PLATFORM) - - project(bcrypt VERSION 1.0.0 LANGUAGES CXX) - - add_library(${PROJECT_NAME} STATIC ${libbcryp_srcs} - ${crypt_blowfish_srcs}) - - if (CMAKE_SYSTEM_NAME MATCHES ".*BSD.*" ) - target_compile_definitions(${PROJECT_NAME} PRIVATE "__SKIP_GNU") - endif() - -else() - idf_build_get_property(CM_PLATFORM CM_PLATFORM) - if(CM_PLATFORM STREQUAL "ESP32") - #ESP32 CMake - project(bcrypt LANGUAGES CXX) - - add_library(${PROJECT_NAME} STATIC - ${libbcryp_srcs} - ${crypt_blowfish_srcs}) - else() - #ERROR - message(SEND_ERROR "You must specify the CMAKE version!") - endif() -endif() - -if(NOT CM_PLATFORM) - set_target_properties(${PROJECT_NAME} - PROPERTIES - C_STANDARD 17 - C_STANDARD_REQUIRED ON - PUBLIC_HEADER "${${PROJECT_NAME}_PUBLIC_HEADERS}" - EXPORT_NAME framework - ) - - target_compile_options(${PROJECT_NAME} - PRIVATE - # Clang - $<$: - > - - # GCC - $<$: - -Wno-cpp - > - - # MSVC - $<$: - > - ) - - ## Target installation - install(TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} - COMPONENT library - ) - - ## Target's cmake files: targets export - install(EXPORT ${PROJECT_NAME}Targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - ) - - ## Target's cmake files: config and version config for find_package() - install(FILES ${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - ) - -endif() diff --git a/third_party/CMakeLists.libhydrogen b/third_party/CMakeLists.libhydrogen deleted file mode 100644 index 248a84ca..00000000 --- a/third_party/CMakeLists.libhydrogen +++ /dev/null @@ -1,67 +0,0 @@ -cmake_minimum_required(VERSION 3.16.0) - -list(APPEND libhydrogen_srcs - hydrogen.c) - -if(NOT CM_PLATFORM) - project(hydrogen VERSION 1.0 LANGUAGES CXX) - - add_library(${PROJECT_NAME} STATIC ${libhydrogen_srcs}) - target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) -else() - idf_build_get_property(CM_PLATFORM CM_PLATFORM) - if(CM_PLATFORM STREQUAL "ESP32") - #ESP32 CMake - project(hydrogen LANGUAGES CXX) - - add_library(${PROJECT_NAME} STATIC - ${libhydrogen_srcs}) - else() - #ERROR - message(SEND_ERROR "You must specify the CMAKE version!") - endif() -endif() - -if(NOT CM_PLATFORM) - - set_target_properties(${PROJECT_NAME} - PROPERTIES - C_STANDARD 17 - C_STANDARD_REQUIRED ON - PUBLIC_HEADER "${${PROJECT_NAME}_PUBLIC_HEADERS}" - EXPORT_NAME framework - ) - - target_compile_options(${PROJECT_NAME} - PRIVATE - # Clang - $<$:> - - # GCC - $<$:> - - # MSVC - $<$:> - ) - - ## Target installation - install(TARGETS ${PROJECT_NAME} - EXPORT ${PROJECT_NAME}Targets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} - COMPONENT library - ) - - ## Target's cmake files: targets export - install(EXPORT ${PROJECT_NAME}Targets - NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - ) - - ## Target's cmake files: config and version config for find_package() - install(FILES ${PROJECT_NAME}Config.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} - ) -endif() diff --git a/third_party/aethernet-numeric b/third_party/aethernet-numeric deleted file mode 160000 index defaf995..00000000 --- a/third_party/aethernet-numeric +++ /dev/null @@ -1 +0,0 @@ -Subproject commit defaf995e285069665c4dd263e2d480283291610 diff --git a/third_party/base-n b/third_party/base-n deleted file mode 160000 index 7573e77c..00000000 --- a/third_party/base-n +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7573e77c0b9b0e8a5fb63d96dbde212c921993b4 diff --git a/third_party/c-ares b/third_party/c-ares deleted file mode 160000 index 89f91c07..00000000 --- a/third_party/c-ares +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 89f91c07436c5d18926f8b2ff3d078787c1c5fe2 diff --git a/third_party/date b/third_party/date deleted file mode 160000 index b2e917ce..00000000 --- a/third_party/date +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b2e917ce6ca8dc11403772f6161b8f69f808c38b diff --git a/third_party/etl b/third_party/etl deleted file mode 160000 index 558c04b0..00000000 --- a/third_party/etl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 558c04b0a0d6714a319e99f50d89048e5686c9d2 diff --git a/third_party/etl.patch b/third_party/etl.patch index 91e3fbd5..3b757c5a 100644 --- a/third_party/etl.patch +++ b/third_party/etl.patch @@ -1,21 +1,16 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index cbe4564d..45ba8cae 100644 +index cbe4564d..2fa1b994 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -39,8 +39,6 @@ target_include_directories(${PROJECT_NAME} ${INCLUDE_SPECIFIER} INTERFACE +@@ -39,8 +39,10 @@ target_include_directories(${PROJECT_NAME} ${INCLUDE_SPECIFIER} INTERFACE target_link_libraries(${PROJECT_NAME} INTERFACE) --# only install if top level project ++option(ENABLE_INSTALL "Enable installation" ON) ++ + # only install if top level project -if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) ++if(ENABLE_INSTALL) # Steps here based on excellent guide: https://dominikberner.ch/cmake-interface-lib/ # Which also details all steps include(CMakePackageConfigHelpers) -@@ -87,7 +85,6 @@ if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME}) - DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/cmake) - install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/etl DESTINATION include) - --endif() - - if (BUILD_TESTS) - enable_testing() diff --git a/third_party/gcem b/third_party/gcem deleted file mode 160000 index f182c6f3..00000000 --- a/third_party/gcem +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f182c6f3d6e0742eb9eef4fff506a3928d4c5107 diff --git a/third_party/ini.h b/third_party/ini.h deleted file mode 160000 index a1662484..00000000 --- a/third_party/ini.h +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a16624847926c12ab0fbc15d22f4f419c8d960c4 diff --git a/third_party/libbcrypt b/third_party/libbcrypt deleted file mode 160000 index 8aa32ad9..00000000 --- a/third_party/libbcrypt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8aa32ad94ebe06b76853b0767c910c9fbf7ccef4 diff --git a/third_party/libbcrypt.patch b/third_party/libbcrypt.patch index 73c38afa..31d2baa6 100644 --- a/third_party/libbcrypt.patch +++ b/third_party/libbcrypt.patch @@ -1,3 +1,73 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..5d324ea +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,64 @@ ++cmake_minimum_required(VERSION 3.16.0) ++ ++include(CMakePackageConfigHelpers) ++include(GNUInstallDirs) ++ ++list(APPEND libbcryp_srcs ++ bcrypt.c) ++ ++list(APPEND crypt_blowfish_srcs ++ crypt_blowfish/crypt_blowfish.c ++ crypt_blowfish/crypt_gensalt.c ++ crypt_blowfish/wrapper.c) ++ ++project(bcrypt VERSION 1.0.0 LANGUAGES CXX) ++ ++add_library(${PROJECT_NAME} STATIC ${libbcryp_srcs} ++ ${crypt_blowfish_srcs}) ++ ++if (CMAKE_SYSTEM_NAME MATCHES ".*BSD.*" ) ++ target_compile_definitions(${PROJECT_NAME} PRIVATE "__SKIP_GNU") ++endif() ++ ++set_target_properties(${PROJECT_NAME} ++ PROPERTIES ++ C_STANDARD 17 ++ C_STANDARD_REQUIRED ON ++ PUBLIC_HEADER "${${PROJECT_NAME}_PUBLIC_HEADERS}" ++ EXPORT_NAME framework ++) ++ ++target_compile_options(${PROJECT_NAME} ++ PRIVATE ++ # GCC ++ $<$: ++ -Wno-cpp ++ > ++) ++ ++target_include_directories(${PROJECT_NAME} ++ PUBLIC ++ $ ++ $ ++) ++ ++ ++option(ENABLE_INSTALL "Enable installation of the library" Off) ++ ++if (ENABLE_INSTALL) ++ ## Target installation ++ install(TARGETS ${PROJECT_NAME} ++ EXPORT ${PROJECT_NAME}Targets ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++ ) ++ ++ install(FILES bcrypt.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ ++ ## Target's cmake files: targets export ++ install(EXPORT ${PROJECT_NAME}Targets ++ NAMESPACE ${PROJECT_NAME}:: ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ ) ++endif() diff --git a/bcrypt.c b/bcrypt.c index bd8722b..ac051c5 100644 --- a/bcrypt.c @@ -78,13 +148,17 @@ index bd8722b..ac051c5 100644 workf = (factor < 4 || factor > 31)?12:factor; aux = crypt_gensalt_rn("$2a$", workf, input, RANDBYTES, diff --git a/crypt_blowfish/ow-crypt.h b/crypt_blowfish/ow-crypt.h -index 2e48794..fbd9de0 100644 +index 2e48794..dccf47b 100644 --- a/crypt_blowfish/ow-crypt.h +++ b/crypt_blowfish/ow-crypt.h -@@ -22,6 +22,10 @@ +@@ -22,6 +22,14 @@ #define __const const #endif ++#ifndef __const ++#define __const const ++#endif ++ +#ifndef __const +#define __const const +#endif diff --git a/third_party/libhydrogen b/third_party/libhydrogen deleted file mode 160000 index bbca575b..00000000 --- a/third_party/libhydrogen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bbca575b62510bfdc6dd927a4bfa7df4a51cb846 diff --git a/third_party/libhydrogen.patch b/third_party/libhydrogen.patch index 879a3017..f5196dec 100644 --- a/third_party/libhydrogen.patch +++ b/third_party/libhydrogen.patch @@ -1,5 +1,147 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2a60a1..d084388 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.1) ++cmake_minimum_required(VERSION 3.16) + + project(hydrogen LANGUAGES C) + +@@ -101,73 +101,78 @@ target_include_directories("${PROJECT_NAME}" + target_compile_options("${PROJECT_NAME}" PRIVATE ${compile_options}) + + # Installation ++option(ENABLE_INSTALL "Enable installation" ON) ++if(ENABLE_INSTALL) ++ set(targets_export_name "${PROJECT_NAME}-targets") + +-set(targets_export_name "${PROJECT_NAME}-targets") ++ install(TARGETS "${PROJECT_NAME}" ++ EXPORT "${targets_export_name}" ++ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ++ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + +-install(TARGETS "${PROJECT_NAME}" +- EXPORT "${targets_export_name}" +- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" +- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") ++ install(FILES ${header_files} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") + +-install(FILES ${header_files} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") ++ # CMake find_package() support + +-# CMake find_package() support ++ set(install_config_dir "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}") + +-set(install_config_dir "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}") ++ set(targets_export_file_name "${targets_export_name}.cmake") ++ set(targets_export_file "${PROJECT_BINARY_DIR}/${targets_export_file_name}") + +-set(targets_export_file_name "${targets_export_name}.cmake") +-set(targets_export_file "${PROJECT_BINARY_DIR}/${targets_export_file_name}") ++ install(EXPORT "${targets_export_name}" ++ FILE "${targets_export_file_name}" ++ NAMESPACE "${PROJECT_NAME}::" ++ DESTINATION "${install_config_dir}") + +-install(EXPORT "${targets_export_name}" +- FILE "${targets_export_file_name}" +- NAMESPACE "${PROJECT_NAME}::" +- DESTINATION "${install_config_dir}") ++ set(config_file_name "${PROJECT_NAME}-config.cmake") ++ set(config_template_file "${PROJECT_SOURCE_DIR}/cmake/${config_file_name}.in") ++ set(config_file "${PROJECT_BINARY_DIR}/${config_file_name}") + +-set(config_file_name "${PROJECT_NAME}-config.cmake") +-set(config_template_file "${PROJECT_SOURCE_DIR}/cmake/${config_file_name}.in") +-set(config_file "${PROJECT_BINARY_DIR}/${config_file_name}") ++ configure_package_config_file("${config_template_file}" "${config_file}" ++ INSTALL_DESTINATION "${install_config_dir}") + +-configure_package_config_file("${config_template_file}" "${config_file}" +- INSTALL_DESTINATION "${install_config_dir}") ++ install(FILES "${config_file}" DESTINATION "${install_config_dir}") + +-install(FILES "${config_file}" DESTINATION "${install_config_dir}") ++ export(EXPORT "${targets_export_name}" FILE "${targets_export_file}" NAMESPACE "${PROJECT_NAME}::") + +-export(EXPORT "${targets_export_name}" FILE "${targets_export_file}" NAMESPACE "${PROJECT_NAME}::") ++ export(PACKAGE "${PROJECT_NAME}") ++endif() + +-export(PACKAGE "${PROJECT_NAME}") + + # Tests +- +-set(tests_executable "${PROJECT_NAME}-tests") +-set(tests_run_target "${PROJECT_NAME}-run-tests") +-set(tests_run_file "${PROJECT_BINARY_DIR}/${tests_run_target}.done") +- +-enable_testing() +-add_executable("${tests_executable}" ${test_files}) +-target_compile_options("${tests_executable}" PRIVATE ${compile_options}) +-target_link_libraries("${tests_executable}" "${PROJECT_NAME}") +-add_test(NAME "${tests_executable}" COMMAND "${tests_executable}") +- +-if(CMAKE_CROSSCOMPILING) +- # Disable tests executable by default when cross-compiling (as it will fail to build when, e.g., +- # cross-compiling for Arduino/AVR). +- set_target_properties("${tests_executable}" +- PROPERTIES +- EXCLUDE_FROM_ALL 1 +- EXCLUDE_FROM_DEFAULT_BUILD 1) +-else() +- # Otherwise, auto-run the tests on build. +- add_custom_command(OUTPUT "${tests_run_file}" +- DEPENDS "${tests_executable}" +- COMMAND "${CMAKE_COMMAND}" +- ARGS -E remove "${tests_run_file}" +- COMMAND "${CMAKE_CTEST_COMMAND}" +- ARGS -C $ --output-on-failure +- COMMAND "${CMAKE_COMMAND}" +- ARGS -E touch "${tests_run_file}" +- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" +- VERBATIM) +- add_custom_target("${tests_run_target}" ALL DEPENDS "${tests_run_file}" VERBATIM) ++option(ENABLE_TESTS "Enable tests" OFF) ++if(ENABLE_TESTS) ++ set(tests_executable "${PROJECT_NAME}-tests") ++ set(tests_run_target "${PROJECT_NAME}-run-tests") ++ set(tests_run_file "${PROJECT_BINARY_DIR}/${tests_run_target}.done") ++ ++ enable_testing() ++ add_executable("${tests_executable}" ${test_files}) ++ target_compile_options("${tests_executable}" PRIVATE ${compile_options}) ++ target_link_libraries("${tests_executable}" "${PROJECT_NAME}") ++ add_test(NAME "${tests_executable}" COMMAND "${tests_executable}") ++ ++ if(CMAKE_CROSSCOMPILING) ++ # Disable tests executable by default when cross-compiling (as it will fail to build when, e.g., ++ # cross-compiling for Arduino/AVR). ++ set_target_properties("${tests_executable}" ++ PROPERTIES ++ EXCLUDE_FROM_ALL 1 ++ EXCLUDE_FROM_DEFAULT_BUILD 1) ++ else() ++ # Otherwise, auto-run the tests on build. ++ add_custom_command(OUTPUT "${tests_run_file}" ++ DEPENDS "${tests_executable}" ++ COMMAND "${CMAKE_COMMAND}" ++ ARGS -E remove "${tests_run_file}" ++ COMMAND "${CMAKE_CTEST_COMMAND}" ++ ARGS -C $ --output-on-failure ++ COMMAND "${CMAKE_COMMAND}" ++ ARGS -E touch "${tests_run_file}" ++ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" ++ VERBATIM) ++ add_custom_target("${tests_run_target}" ALL DEPENDS "${tests_run_file}" VERBATIM) ++ endif() + endif() + + # Generate Arduino package diff --git a/impl/random.h b/impl/random.h -index b85a4a1..acd24eb 100644 +index bb18c5c..62c53b1 100644 --- a/impl/random.h +++ b/impl/random.h @@ -7,7 +7,16 @@ static TLS struct { diff --git a/third_party/libsodium b/third_party/libsodium deleted file mode 160000 index 29090390..00000000 --- a/third_party/libsodium +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2909039095d1bf45ad86f647f45f53ecc6b347c9 diff --git a/third_party/libsodium_cmake.patch b/third_party/libsodium_cmake.patch new file mode 100644 index 00000000..7fc8645f --- /dev/null +++ b/third_party/libsodium_cmake.patch @@ -0,0 +1,70 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +new file mode 100644 +index 0000000..f526c08 +--- /dev/null ++++ b/CMakeLists.txt +@@ -0,0 +1,64 @@ ++cmake_minimum_required(VERSION 3.16.0) ++ ++include(CMakePackageConfigHelpers) ++include(GNUInstallDirs) ++ ++set(SODIUM_LIBRARY_VERSION_MAJOR 28) ++set(SODIUM_LIBRARY_VERSION_MINOR 0) ++set(VERSION 1.0.19) ++ ++project(sodium VERSION ${VERSION} LANGUAGES CXX) ++ ++configure_file( ++ "${CMAKE_CURRENT_LIST_DIR}/src/libsodium/include/sodium/version.h.in" ++ "${CMAKE_CURRENT_LIST_DIR}/src/libsodium/include/sodium/version.h" ++ @ONLY ) ++ ++file(GLOB_RECURSE libsodium_srcs RELATIVE ${CMAKE_CURRENT_LIST_DIR} "src/libsodium/*.c") ++ ++ ++add_library(${PROJECT_NAME} STATIC ${libsodium_srcs}) ++ ++target_include_directories(${PROJECT_NAME} PUBLIC ++ $ ++ $) ++ ++target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/libsodium) ++target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/libsodium/include/sodium) ++target_compile_definitions(${PROJECT_NAME} PRIVATE DEV_MODE=1 CONFIGURED=1) ++ ++set_target_properties(${PROJECT_NAME} ++ PROPERTIES ++ C_STANDARD 17 ++ C_STANDARD_REQUIRED ON ++ PUBLIC_HEADER "${${PROJECT_NAME}_PUBLIC_HEADERS}" ++ EXPORT_NAME framework ++) ++ ++target_compile_definitions(${PROJECT_NAME} PUBLIC SODIUM_STATIC) ++ ++target_compile_options(${PROJECT_NAME} PRIVATE ++ $<$:-Wno-error=array-parameter -Wno-error=unknown-pragmas> ++ $<$:-Wno-error=array-parameter -Wno-error=unknown-pragmas> ++) ++ ++option(ENABLE_INSTALL "Enable installation" ON) ++ ++if(ENABLE_INSTALL) ++ ## Target installation ++ install(TARGETS ${PROJECT_NAME} ++ EXPORT ${PROJECT_NAME}Targets ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME} ++ ) ++ ++ install(DIRECTORY src/libsodium/include/sodium DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ FILES_MATCHING PATTERN "*.h") ++ install(FILES src/libsodium/include/sodium.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/) ++ ++ ## Target's cmake files: targets export ++ install(EXPORT ${PROJECT_NAME}Targets ++ NAMESPACE ${PROJECT_NAME}:: ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ ) ++endif() diff --git a/tools/registrator/CMakeLists.txt b/tools/registrator/CMakeLists.txt index 0982766a..28c9ef3a 100644 --- a/tools/registrator/CMakeLists.txt +++ b/tools/registrator/CMakeLists.txt @@ -17,6 +17,15 @@ cmake_minimum_required(VERSION 3.16.0) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +include(../../cmake/CPM.cmake) + +CPMAddPackage( + NAME "ini.h" + GIT_REPOSITORY "https://github.com/giosali/ini.h" + GIT_TAG "a166248" +) +set(ini_INCLUDE_DIR ${ini.h_SOURCE_DIR}) + if(NOT TARGET aether) add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../aether aether) endif() @@ -44,7 +53,7 @@ project("aether-registrator" VERSION "1.0.0" LANGUAGES C CXX) add_executable(${PROJECT_NAME} ${src_list}) target_link_libraries(${PROJECT_NAME} PRIVATE aether) -target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/..) +target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/.. ${ini_INCLUDE_DIR}) include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} diff --git a/tools/registrator/registrator_config.cpp b/tools/registrator/registrator_config.cpp index f75f0820..2626977f 100644 --- a/tools/registrator/registrator_config.cpp +++ b/tools/registrator/registrator_config.cpp @@ -16,7 +16,7 @@ #include "registrator/registrator_config.h" -#include "third_party/ini.h/ini.h" +#include #include #include From c3009ecb589d48c373caf614191aebaf639db4a9 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Fri, 29 May 2026 16:51:22 +0500 Subject: [PATCH 5/8] include projects new way --- examples/cloud/CMakeLists.txt | 11 ++++++++++- .../platformio/aether-client-cpp/CMakeLists.txt | 3 +-- .../vscode/aether-client-cpp/CMakeLists.txt | 3 +-- .../platformio/aether-client-cpp/CMakeLists.txt | 3 +-- .../vscode/aether-client-cpp/CMakeLists.txt | 3 +-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/examples/cloud/CMakeLists.txt b/examples/cloud/CMakeLists.txt index 57b46bff..43df7b18 100644 --- a/examples/cloud/CMakeLists.txt +++ b/examples/cloud/CMakeLists.txt @@ -34,7 +34,16 @@ else() #ESP32 CMake idf_component_register(SRCS ${src_list} INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR} - PRIV_REQUIRES aether) + REQUIRES + esp_wifi + esp_netif + nvs_flash + spiffs + esp_driver_uart + ) + + add_subdirectory("../../aether" aether) + target_link_libraries(${COMPONENT_LIB} PRIVATE aether) else() #Other platforms message(FATAL_ERROR "Platform ${CM_PLATFORM} is not supported") diff --git a/projects/espressif_riscv/platformio/aether-client-cpp/CMakeLists.txt b/projects/espressif_riscv/platformio/aether-client-cpp/CMakeLists.txt index b09da698..105984f3 100644 --- a/projects/espressif_riscv/platformio/aether-client-cpp/CMakeLists.txt +++ b/projects/espressif_riscv/platformio/aether-client-cpp/CMakeLists.txt @@ -29,8 +29,7 @@ endif() # enable doubles in unity tests add_compile_definitions("CONFIG_UNITY_ENABLE_DOUBLE") -list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether" - "../../../../examples/cloud" +list(APPEND EXTRA_COMPONENT_DIRS "../../../../examples/cloud" # "../../../../examples/benches/send_message_delays" ) diff --git a/projects/espressif_riscv/vscode/aether-client-cpp/CMakeLists.txt b/projects/espressif_riscv/vscode/aether-client-cpp/CMakeLists.txt index 4fc68fdc..df328666 100644 --- a/projects/espressif_riscv/vscode/aether-client-cpp/CMakeLists.txt +++ b/projects/espressif_riscv/vscode/aether-client-cpp/CMakeLists.txt @@ -33,9 +33,8 @@ endif() # enable doubles in unity tests add_compile_definitions("CONFIG_UNITY_ENABLE_DOUBLE") -list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether" +list(APPEND EXTRA_COMPONENT_DIRS "../../../../examples/cloud" "../../../../examples/c_api" - "../../../../examples/cloud" "../../../../examples/benches/send_message_delays" ) diff --git a/projects/xtensa_lx6/platformio/aether-client-cpp/CMakeLists.txt b/projects/xtensa_lx6/platformio/aether-client-cpp/CMakeLists.txt index b09da698..105984f3 100644 --- a/projects/xtensa_lx6/platformio/aether-client-cpp/CMakeLists.txt +++ b/projects/xtensa_lx6/platformio/aether-client-cpp/CMakeLists.txt @@ -29,8 +29,7 @@ endif() # enable doubles in unity tests add_compile_definitions("CONFIG_UNITY_ENABLE_DOUBLE") -list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether" - "../../../../examples/cloud" +list(APPEND EXTRA_COMPONENT_DIRS "../../../../examples/cloud" # "../../../../examples/benches/send_message_delays" ) diff --git a/projects/xtensa_lx6/vscode/aether-client-cpp/CMakeLists.txt b/projects/xtensa_lx6/vscode/aether-client-cpp/CMakeLists.txt index f81e5a2b..3560ed07 100644 --- a/projects/xtensa_lx6/vscode/aether-client-cpp/CMakeLists.txt +++ b/projects/xtensa_lx6/vscode/aether-client-cpp/CMakeLists.txt @@ -33,8 +33,7 @@ endif() # enable doubles in unity tests add_compile_definitions("CONFIG_UNITY_ENABLE_DOUBLE") -list(APPEND EXTRA_COMPONENT_DIRS "../../../../aether" - "../../../../examples/cloud" +list(APPEND EXTRA_COMPONENT_DIRS "../../../../examples/cloud" "../../../../examples/capi/oddity" "../../../../examples/benches/send_message_delays" ) From e75b3e6db18370596b8cc592bd7818f32c5d3e2c Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 1 Jun 2026 10:47:24 +0500 Subject: [PATCH 6/8] format ci-cppcheck --- .github/workflows/ci-cppcheck.yml | 103 +++++++++++++++--------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci-cppcheck.yml b/.github/workflows/ci-cppcheck.yml index ba539dd8..2da30d59 100644 --- a/.github/workflows/ci-cppcheck.yml +++ b/.github/workflows/ci-cppcheck.yml @@ -13,26 +13,26 @@ jobs: cppcheck: runs-on: ubuntu-latest steps: - - name: configure system - run: | - sudo apt-get update - sudo apt-get install -y make ninja-build + - name: configure system + run: | + sudo apt-get update + sudo apt-get install -y make ninja-build - - uses: actions/checkout@v4 - with: + - uses: actions/checkout@v4 + with: submodules: recursive - - name: cache cppcheck - id: cache-cppcheck - uses: actions/cache@v4 - with: - path: _cppcheck - key: ${{ runner.os }}-cppcheck-2.19.0 - restore-keys: ${{ runner.os }}-cppcheck-2.19.0 + - name: cache cppcheck + id: cache-cppcheck + uses: actions/cache@v4 + with: + path: _cppcheck + key: ${{ runner.os }}-cppcheck-2.19.0 + restore-keys: ${{ runner.os }}-cppcheck-2.19.0 - - if: ${{ steps.cache-cppcheck.outputs.cache-hit != 'true' }} - name: download and build cppcheck - run: | + - if: ${{ steps.cache-cppcheck.outputs.cache-hit != 'true' }} + name: download and build cppcheck + run: | mkdir -p _cppcheck wget -O _cppcheck/cppcheck.tar.gz https://github.com/danmar/cppcheck/archive/refs/tags/2.19.0.tar.gz cd _cppcheck @@ -45,43 +45,42 @@ jobs: cd ../.. _cppcheck/cppcheck-2.19.0/cppcheck --version - # we need configure cmake to get the compile_commands.json file - - name: cmake configure - run: > - cmake -B build - -G Ninja - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - -DCMAKE_BUILD_TYPE=Release - -C ".github/workflows/linux_initial_cache.txt" - -S projects/cmake + # we need configure cmake to get the compile_commands.json file + - name: cmake configure + run: > + cmake -B build + -G Ninja + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + -DCMAKE_BUILD_TYPE=Release + -C ".github/workflows/linux_initial_cache.txt" + -S projects/cmake - - name: cache cppcheck_build_dir - id: cache-cppcheck_build_dir - uses: actions/cache@v4 - with: - path: _cppcheck_build_dir - key: ${{ runner.os }}-cppcheck_build_dir - restore-keys: ${{ runner.os }}-cppcheck_build_dir + - name: cache cppcheck_build_dir + id: cache-cppcheck_build_dir + uses: actions/cache@v4 + with: + path: _cppcheck_build_dir + key: ${{ runner.os }}-cppcheck_build_dir + restore-keys: ${{ runner.os }}-cppcheck_build_dir - # _cppcheck_build_dir is required to increase cppcheck check speed - - if: ${{ steps.cache-cppcheck_build_dir.outputs.cache-hit != 'true' }} - name: cppcheck_build_dir - run: mkdir -p _cppcheck_build_dir + # _cppcheck_build_dir is required to increase cppcheck check speed + - if: ${{ steps.cache-cppcheck_build_dir.outputs.cache-hit != 'true' }} + name: cppcheck_build_dir + run: mkdir -p _cppcheck_build_dir - - name: cppcheck - run: > - ./_cppcheck/cppcheck-2.19.0/cppcheck --project=build/compile_commands.json - -D__GNUC__=4 - --safety - --error-exitcode=-1 - -i "third_party/*" - --enable=warning,performance,portability,missingInclude - --suppressions-list=./cppcheck_suppressions.txt - --inline-suppr - --quiet - -j $(nproc) - --cppcheck-build-dir=./_cppcheck_build_dir - --checkers-report=./checkers.txt + - name: cppcheck + run: > + ./_cppcheck/cppcheck-2.19.0/cppcheck --project=build/compile_commands.json + -D__GNUC__=4 + --safety + --error-exitcode=-1 + --enable=warning,performance,portability,missingInclude + --suppressions-list=./cppcheck_suppressions.txt + --inline-suppr + --quiet + -j $(nproc) + --cppcheck-build-dir=./_cppcheck_build_dir + --checkers-report=./checkers.txt - - name: print checkers report - run: cat checkers.txt + - name: print checkers report + run: cat checkers.txt From 8ba1024efeb1532dc547d055be176af842d3f7a0 Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 1 Jun 2026 10:47:39 +0500 Subject: [PATCH 7/8] fix include unity.h --- tests/inline_tests/tests/inline.h | 2 +- tests/inline_tests/tests/main.cpp.in | 2 +- tests/test-ptr/test-ptr-inheritance.cpp | 1 - tests/test-stream/templated-streams/test_templated_streams.cpp | 2 +- tests/test-tasks/test-task-subscriptions.cpp | 2 +- tests/test-types/test-literal-array.cpp | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/inline_tests/tests/inline.h b/tests/inline_tests/tests/inline.h index 9c160bf5..e2e6d975 100644 --- a/tests/inline_tests/tests/inline.h +++ b/tests/inline_tests/tests/inline.h @@ -22,7 +22,7 @@ #include #include -#include "unity.h" +#include #include "tests/crc.h" diff --git a/tests/inline_tests/tests/main.cpp.in b/tests/inline_tests/tests/main.cpp.in index 964ed7e8..3ba073a3 100644 --- a/tests/inline_tests/tests/main.cpp.in +++ b/tests/inline_tests/tests/main.cpp.in @@ -19,7 +19,7 @@ * \see tests/inline_tests/CMakeLists.txt */ -#include "unity.h" +#include #define TEST_FILE "@TEST_FILE@" diff --git a/tests/test-ptr/test-ptr-inheritance.cpp b/tests/test-ptr/test-ptr-inheritance.cpp index 5a0f316f..7f77d7d1 100644 --- a/tests/test-ptr/test-ptr-inheritance.cpp +++ b/tests/test-ptr/test-ptr-inheritance.cpp @@ -17,7 +17,6 @@ #include #include "aether/ptr/ptr.h" -#include "unity_internals.h" namespace ae::test_ptr_inheritance { struct BaseA { diff --git a/tests/test-stream/templated-streams/test_templated_streams.cpp b/tests/test-stream/templated-streams/test_templated_streams.cpp index 82715f63..6eb251ae 100644 --- a/tests/test-stream/templated-streams/test_templated_streams.cpp +++ b/tests/test-stream/templated-streams/test_templated_streams.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "unity.h" +#include #include "aether/stream_api/gates_stream.h" diff --git a/tests/test-tasks/test-task-subscriptions.cpp b/tests/test-tasks/test-task-subscriptions.cpp index ce3c86bc..712559bf 100644 --- a/tests/test-tasks/test-task-subscriptions.cpp +++ b/tests/test-tasks/test-task-subscriptions.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "unity.h" +#include #include "aether/tasks/details/task.h" #include "aether/tasks/details/generic_task.h" diff --git a/tests/test-types/test-literal-array.cpp b/tests/test-types/test-literal-array.cpp index a6c4b1bf..0a479c75 100644 --- a/tests/test-types/test-literal-array.cpp +++ b/tests/test-types/test-literal-array.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "unity.h" +#include #include "aether/types/literal_array.h" From 39fa6c52592b62d54a93966b7507c6ea7aaa9ecb Mon Sep 17 00:00:00 2001 From: BartolomeyKant Date: Mon, 1 Jun 2026 10:47:51 +0500 Subject: [PATCH 8/8] fix cppcheck issues --- aether/connection_manager/client_cloud_manager.cpp | 2 +- aether/connection_manager/client_cloud_manager.h | 2 +- aether/server_connections/client_server_connection.cpp | 2 ++ cppcheck_suppressions.txt | 5 +++-- examples/benches/send_message_delays/sender.cpp | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/aether/connection_manager/client_cloud_manager.cpp b/aether/connection_manager/client_cloud_manager.cpp index f17d9190..a8eab74b 100644 --- a/aether/connection_manager/client_cloud_manager.cpp +++ b/aether/connection_manager/client_cloud_manager.cpp @@ -47,7 +47,7 @@ GetCloudFromAether::GetCloudFromAether(AeContext const& ae_context, Aether& aether, ClientCloudManager& client_cloud_manager, CloudServerConnections& cloud_connection, - Uid client_uid) + Uid const& client_uid) : ae_context_{ae_context}, aether_{&aether}, client_cloud_manager_{&client_cloud_manager}, diff --git a/aether/connection_manager/client_cloud_manager.h b/aether/connection_manager/client_cloud_manager.h index a152ad87..2e18c273 100644 --- a/aether/connection_manager/client_cloud_manager.h +++ b/aether/connection_manager/client_cloud_manager.h @@ -68,7 +68,7 @@ class GetCloudFromAether final : public GetCloudAction { explicit GetCloudFromAether(AeContext const& ae_context, Aether& aether, ClientCloudManager& client_cloud_manager, CloudServerConnections& cloud_connection, - Uid client_uid); + Uid const& client_uid); ResultEvent::Subscriber result_event() noexcept override; diff --git a/aether/server_connections/client_server_connection.cpp b/aether/server_connections/client_server_connection.cpp index 28706126..50c2cfa7 100644 --- a/aether/server_connections/client_server_connection.cpp +++ b/aether/server_connections/client_server_connection.cpp @@ -188,6 +188,8 @@ WriteAction& ClientServerConnection::AuthorizedApiCall( SubApi auth_api) { auto api_call = ApiCallAdapter{ApiContext{login_api_}, server_connection_}; api_call->login_by_alias(ephemeral_uid_, std::move(auth_api)); + // cppcheck reports false positive + // cppcheck-suppress returnReference return api_call.Flush(); } diff --git a/cppcheck_suppressions.txt b/cppcheck_suppressions.txt index 491c86a1..62fcffb4 100644 --- a/cppcheck_suppressions.txt +++ b/cppcheck_suppressions.txt @@ -3,12 +3,13 @@ functionStatic unusedFunction duplInheritedMember - -*:third_party/* +*:cpm.cache/* +*:_deps/* *:esp-idf/* useInitializationList:tests/* returnDanglingLifetime:tests/* +danglingTemporaryLifetime:tests/* accessMoved:tests/* // sometimes it's specially checked if var is moved cstyleCast:tests/* // c-style cast is heavily used in tests dangerousTypeCast:tests/* // c-style cast is heavily used in tests diff --git a/examples/benches/send_message_delays/sender.cpp b/examples/benches/send_message_delays/sender.cpp index c0ac6ee9..9f77c2af 100644 --- a/examples/benches/send_message_delays/sender.cpp +++ b/examples/benches/send_message_delays/sender.cpp @@ -33,6 +33,7 @@ Sender::Sender(AeContext const& ae_context, Client::ptr client, client_{std::move(client)}, destination_uid_{destination_uid}, safe_stream_config_{safe_stream_config}, + connected_stream_{}, bench_delays_api_{protocol_context_} {} void Sender::ConnectP2pStream() {