From f64cdcaacf7c90e27a9755c82889801e283c4538 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Fri, 1 May 2026 13:23:10 -0700 Subject: [PATCH] extract ipv4 into its own static library --- CMakeLists.txt | 3 ++- ipv4/CMakeLists.txt | 11 +++++++++++ {src => ipv4}/ipv4.cpp | 0 {include => ipv4}/ipv4.h | 0 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ipv4/CMakeLists.txt rename {src => ipv4}/ipv4.cpp (100%) rename {include => ipv4}/ipv4.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f88c959..2e8dfeb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,7 @@ add_subdirectory(w6300) add_subdirectory(debug_log) add_subdirectory(msgpack) add_subdirectory(eth) +add_subdirectory(ipv4) add_library(limen STATIC src/arp.cpp @@ -13,7 +14,6 @@ add_library(limen STATIC src/handlers.cpp src/icmp.cpp src/igmp.cpp - src/ipv4.cpp src/test_handlers.cpp src/udp.cpp ) @@ -30,6 +30,7 @@ target_link_libraries(limen PUBLIC debug_log msgpack eth + ipv4 pico_stdlib pico_sha256 ) diff --git a/ipv4/CMakeLists.txt b/ipv4/CMakeLists.txt new file mode 100644 index 0000000..6767e0b --- /dev/null +++ b/ipv4/CMakeLists.txt @@ -0,0 +1,11 @@ +add_library(ipv4 STATIC ipv4.cpp) + +target_include_directories(ipv4 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_compile_options(ipv4 PRIVATE -Wall -Wextra -Wno-unused-parameter) + +target_link_libraries(ipv4 PUBLIC + util + eth + debug_log +) diff --git a/src/ipv4.cpp b/ipv4/ipv4.cpp similarity index 100% rename from src/ipv4.cpp rename to ipv4/ipv4.cpp diff --git a/include/ipv4.h b/ipv4/ipv4.h similarity index 100% rename from include/ipv4.h rename to ipv4/ipv4.h