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
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 @@
 
     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 @@
             ${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 @@
     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