From c4f37b2e4410ed060474e848ce16b20b83f4a96b Mon Sep 17 00:00:00 2001 From: Peter Harper <77111776+peterharperuk@users.noreply.github.com> Date: Sun, 16 Oct 2022 22:38:42 +0100 Subject: [PATCH] Lwip build fixes (#1011) Only build lwip acd.c if it exists (after 2.1.3) Some mdns files only exist in 2.2.x Fixes #1009 --- src/rp2_common/pico_lwip/CMakeLists.txt | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/rp2_common/pico_lwip/CMakeLists.txt b/src/rp2_common/pico_lwip/CMakeLists.txt index 643e262..db3096c 100644 --- a/src/rp2_common/pico_lwip/CMakeLists.txt +++ b/src/rp2_common/pico_lwip/CMakeLists.txt @@ -53,7 +53,6 @@ if (EXISTS ${PICO_LWIP_PATH}/${LWIP_TEST_PATH}) add_library(pico_lwip_core4 INTERFACE) target_sources(pico_lwip_core4 INTERFACE - ${PICO_LWIP_PATH}/src/core/ipv4/acd.c ${PICO_LWIP_PATH}/src/core/ipv4/autoip.c ${PICO_LWIP_PATH}/src/core/ipv4/dhcp.c ${PICO_LWIP_PATH}/src/core/ipv4/etharp.c @@ -64,6 +63,13 @@ if (EXISTS ${PICO_LWIP_PATH}/${LWIP_TEST_PATH}) ${PICO_LWIP_PATH}/src/core/ipv4/ip4_addr.c ) + # Doesn't exists in version earlier than 2.1.3 + if (EXISTS ${PICO_LWIP_PATH}/src/core/ipv4/acd.c) + target_sources(pico_lwip_core4 INTERFACE + ${PICO_LWIP_PATH}/src/core/ipv4/acd.c + ) + endif() + add_library(pico_lwip_core6 INTERFACE) target_sources(pico_lwip_core6 INTERFACE ${PICO_LWIP_PATH}/src/core/ipv6/dhcp6.c @@ -207,10 +213,16 @@ if (EXISTS ${PICO_LWIP_PATH}/${LWIP_TEST_PATH}) add_library(pico_lwip_mdns INTERFACE) target_sources(pico_lwip_mdns INTERFACE ${PICO_LWIP_PATH}/src/apps/mdns/mdns.c - ${PICO_LWIP_PATH}/src/apps/mdns/mdns_out.c - ${PICO_LWIP_PATH}/src/apps/mdns/mdns_domain.c ) + # Old versions of lwip had everything in mdns.c + if (EXISTS ${PICO_LWIP_PATH}/src/apps/mdns/mdns_out.c) + target_sources(pico_lwip_mdns INTERFACE + ${PICO_LWIP_PATH}/src/apps/mdns/mdns_out.c + ${PICO_LWIP_PATH}/src/apps/mdns/mdns_domain.c + ) + endif() + # NetBIOS name server add_library(pico_lwip_netbios INTERFACE) target_sources(pico_lwip_netbios INTERFACE