From de14f8204880e0cbeef2c8414db68b5c0bf23a40 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 23 Jul 2026 22:46:48 +0300 Subject: [PATCH] chatgui: replace manual source lists with file(GLOB) in libutun/CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libutun/CMakeLists.txt: 151→84 lines (-67) UASYNC_SOURCES: file(GLOB /*.c /liblmdb/*.c) UTUN_COMMON_SOURCES: file(GLOB_RECURSE /*.c) excluding lwip_orig/, uip/, transport_layer/BBR/, utun.c New .c files in src/ or lib/ are now automatically included. --- tools/chatgui/libutun/CMakeLists.txt | 81 +++------------------------- 1 file changed, 7 insertions(+), 74 deletions(-) diff --git a/tools/chatgui/libutun/CMakeLists.txt b/tools/chatgui/libutun/CMakeLists.txt index 9e935040..e6336647 100644 --- a/tools/chatgui/libutun/CMakeLists.txt +++ b/tools/chatgui/libutun/CMakeLists.txt @@ -8,26 +8,7 @@ set(TRANSPORT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../transport) # libuasync — low-level runtime library # ============================================================================ -set(UASYNC_SOURCES - ${LIB_DIR}/ll_queue.c - ${LIB_DIR}/u_async.c - ${LIB_DIR}/debug_config.c - ${LIB_DIR}/timeout_heap.c - ${LIB_DIR}/memory_pool.c - ${LIB_DIR}/sha256.c - ${LIB_DIR}/socket_compat.c - ${LIB_DIR}/platform_compat.c - ${LIB_DIR}/getmyip.c - ${LIB_DIR}/swm_min.c - ${LIB_DIR}/mem.c - ${LIB_DIR}/radix.c - ${LIB_DIR}/serialize.c - ${LIB_DIR}/json_flat.c - ${LIB_DIR}/tcp_io.c - ${LIB_DIR}/sqlite3.c - ${LIB_DIR}/liblmdb/mdb.c - ${LIB_DIR}/liblmdb/midl.c -) +file(GLOB UASYNC_SOURCES "${LIB_DIR}/*.c" "${LIB_DIR}/liblmdb/*.c") add_library(uasync STATIC ${UASYNC_SOURCES}) @@ -51,60 +32,12 @@ set_target_properties(uasync PROPERTIES # libutun — VPN core library (all src/ except utun.c) # ============================================================================ -# Common sources (all platforms) -set(UTUN_COMMON_SOURCES - ${SRC_DIR}/utun_instance.c - ${SRC_DIR}/config_parser.c - ${SRC_DIR}/config_updater.c - ${SRC_DIR}/routing_layer/route_lib.c - ${SRC_DIR}/routing_layer/route6_lib.c - ${SRC_DIR}/routing_layer/topo_group.c - ${SRC_DIR}/routing_layer/route_ping.c - ${SRC_DIR}/routing_layer/nat_detection.c - ${SRC_DIR}/routing_layer/topo_node.c - ${SRC_DIR}/routing_layer/topo_node_sqlite.c - ${SRC_DIR}/routing_layer/route_connectivity.c - ${SRC_DIR}/db_sync.c - ${SRC_DIR}/routing_layer/conn_mgr.c - ${SRC_DIR}/routing_layer/topo_recovery.c - ${SRC_DIR}/routing_layer/topo_group_connect.c - ${SRC_DIR}/routing_layer/routing.c - ${SRC_DIR}/tun_if.c - ${SRC_DIR}/tun_route.c - ${SRC_DIR}/transport_layer/etcp.c - ${SRC_DIR}/transport_layer/etcp_connections.c - ${SRC_DIR}/transport_layer/etcp_bbr.c - ${SRC_DIR}/transport_layer/etcp_loadbalancer.c - ${SRC_DIR}/transport_layer/etcp_debug.c - ${SRC_DIR}/transport_layer/etcp_dump.c - ${SRC_DIR}/transport_layer/secure_channel.c - ${SRC_DIR}/transport_layer/crc32.c - ${SRC_DIR}/transport_layer/stcp_link.c - ${SRC_DIR}/transport_layer/stcp.c - ${SRC_DIR}/transport_layer/stcp_server.c - ${SRC_DIR}/transport_layer/stcp_client.c - ${SRC_DIR}/transport_layer/pkt_normalizer.c - ${SRC_DIR}/transport_layer/packet_dump.c - ${SRC_DIR}/transport_layer/etcp_api.c - ${SRC_DIR}/transport_layer/etcp_connect.c - ${SRC_DIR}/control_server.c - ${SRC_DIR}/firewall.c - ${SRC_DIR}/eim_nat.c - ${SRC_DIR}/nat_transport.c - ${SRC_DIR}/transport_layer/dummynet.c - ${SRC_DIR}/ntp_time.c - ${SRC_DIR}/ntp_node_time.c - ${SRC_DIR}/routing_layer/etcp_router.c - ${SRC_DIR}/proxy/tcp_proxy_client.c - ${SRC_DIR}/proxy/tcp_proxy_server.c - ${SRC_DIR}/proxy/udp_proxy.c - ${SRC_DIR}/proxy/socks_proxy.c - ${SRC_DIR}/proxy/icmp_proxy.c - ${SRC_DIR}/lwip_tcp/lwip_pbuf.c - ${SRC_DIR}/lwip_tcp/lwip_tcp.c - ${SRC_DIR}/lwip_tcp/lwip_tcp_in.c - ${SRC_DIR}/lwip_tcp/lwip_tcp_out.c -) +# Common sources (all platforms) — all .c from src/ except main entry point and ref/ dirs +file(GLOB_RECURSE UTUN_COMMON_SOURCES "${SRC_DIR}/*.c") +list(FILTER UTUN_COMMON_SOURCES EXCLUDE REGEX "/lwip_orig/") +list(FILTER UTUN_COMMON_SOURCES EXCLUDE REGEX "/uip/") +list(FILTER UTUN_COMMON_SOURCES EXCLUDE REGEX "/transport_layer/BBR/") +list(REMOVE_ITEM UTUN_COMMON_SOURCES "${SRC_DIR}/utun.c") # Platform-specific TUN implementation if(CMAKE_SYSTEM_NAME STREQUAL "Linux")