harktech: move vendored mdns into deps_src/ per repo convention

Per @SoftFever review on #13752, third-party vendored libraries belong in
deps_src/ alongside expat, imgui, hidapi, etc.

- All 5 files (mdns.{h,c}, cxmdns.{h,cpp}, NOTICE.md) move from
  src/slic3r/Utils/mdns/ to deps_src/mdns/.
- deps_src/mdns/CMakeLists.txt builds mdns as a STATIC library and scopes
  the MSVC Iphlpapi/Ws2_32 link requirement to that target instead of
  libslic3r_gui's global MSVC block.
- deps_src/CMakeLists.txt gains add_subdirectory(mdns).
- src/slic3r/CMakeLists.txt drops the inline source listings and links
  libslic3r_gui against the new mdns target; MSVC block keeps only
  Setupapi.lib.
- src/slic3r/Utils/CrealityHostDiscovery.cpp #include updated to use the
  include dir exposed by the new mdns target.

Verified by a clean Linux build (orca-slicer links successfully).
This commit is contained in:
grant0013
2026-05-20 11:16:13 +00:00
parent 7349464392
commit d643701529
9 changed files with 23 additions and 9 deletions

View File

@@ -27,6 +27,7 @@ add_subdirectory(libigl)
add_subdirectory(libnest2d)
add_subdirectory(mcut)
add_subdirectory(md4c)
add_subdirectory(mdns)
add_subdirectory(miniz)
add_subdirectory(minilzo)
add_subdirectory(qhull)

View File

@@ -0,0 +1,19 @@
cmake_minimum_required(VERSION 3.13)
project(mdns)
# Static library wrapping mjansson/mdns (public domain) plus the cxmdns C++
# wrapper from CrealityPrint v7.1.1 (AGPL-3.0). See NOTICE.md for attribution.
add_library(mdns STATIC
mdns.h
mdns.c
cxmdns.h
cxmdns.cpp
)
target_include_directories(mdns SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
if (MSVC)
# mjansson/mdns uses GetAdaptersAddresses (Iphlpapi) and Winsock2 (Ws2_32).
target_link_libraries(mdns PUBLIC Iphlpapi Ws2_32)
endif()

View File

@@ -669,10 +669,6 @@ set(SLIC3R_GUI_SOURCES
Utils/WxFontUtils.hpp
Utils/FileTransferUtils.cpp
Utils/FileTransferUtils.hpp
Utils/mdns/mdns.h
Utils/mdns/mdns.c
Utils/mdns/cxmdns.h
Utils/mdns/cxmdns.cpp
)
add_subdirectory(GUI/DeviceCore)
@@ -762,13 +758,11 @@ else()
set(_opengl_link_lib OpenGL::GL)
endif()
target_link_libraries(libslic3r_gui libslic3r cereal::cereal imgui imguizmo minilzo libvgcode md4c-html glad ${_opengl_link_lib} hidapi ${wxWidgets_LIBRARIES} glfw libcurl OpenSSL::SSL OpenSSL::Crypto noise::noise)
target_link_libraries(libslic3r_gui libslic3r cereal::cereal imgui imguizmo minilzo libvgcode md4c-html glad ${_opengl_link_lib} hidapi mdns ${wxWidgets_LIBRARIES} glfw libcurl OpenSSL::SSL OpenSSL::Crypto noise::noise)
if (MSVC)
# Iphlpapi/Ws2_32 are required by the vendored mjansson/mdns library
# (GetAdaptersAddresses + Winsock2) used by CrealityHostDiscovery.
target_link_libraries(libslic3r_gui Setupapi.lib Iphlpapi.lib Ws2_32.lib)
target_link_libraries(libslic3r_gui Setupapi.lib)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
FIND_LIBRARY(WAYLAND_SERVER_LIBRARIES NAMES wayland-server)
FIND_LIBRARY(WAYLAND_EGL_LIBRARIES NAMES wayland-egl)

View File

@@ -1,5 +1,5 @@
#include "CrealityHostDiscovery.hpp"
#include "mdns/cxmdns.h"
#include "cxmdns.h"
#include "Http.hpp"
#include <boost/log/trivial.hpp>