2023-01-12 14:45:12 +08:00
|
|
|
vcpkg_from_github(
|
2019-10-08 01:35:13 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
2023-01-12 14:45:12 +08:00
|
|
|
REPO apple-oss-distributions/mDNSResponder
|
|
|
|
REF f783506af3836b39b83fc14115bc2728a49db4b2 #mDNSResponder-1557.140.5.0.1
|
|
|
|
SHA512 f5954d3f8ef40790e14d17de4cd861fc7df6900e54affefb8282f080a0bfc8b4ac9d238f2faaea6bb3849b342836e45f3b2cb9361402f89fcdce3c627a2b9b4d
|
|
|
|
HEAD_REF main
|
2019-10-08 01:35:13 +08:00
|
|
|
)
|
2017-04-16 02:24:29 +08:00
|
|
|
|
|
|
|
IF (TRIPLET_SYSTEM_ARCH MATCHES "x86")
|
|
|
|
SET(BUILD_ARCH "Win32")
|
|
|
|
ELSE()
|
|
|
|
SET(BUILD_ARCH ${TRIPLET_SYSTEM_ARCH})
|
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
function(FIX_VCXPROJ VCXPROJ_PATH)
|
|
|
|
file(READ ${VCXPROJ_PATH} ORIG)
|
2019-11-20 14:21:43 +08:00
|
|
|
if(${VCPKG_CRT_LINKAGE} STREQUAL "dynamic")
|
2017-04-16 02:24:29 +08:00
|
|
|
string(REGEX REPLACE
|
2019-11-20 14:21:43 +08:00
|
|
|
"<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>"
|
2017-04-16 02:24:29 +08:00
|
|
|
"<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>"
|
|
|
|
ORIG "${ORIG}")
|
|
|
|
string(REGEX REPLACE
|
2019-11-20 14:21:43 +08:00
|
|
|
"<RuntimeLibrary>MultiThreaded</RuntimeLibrary>"
|
2017-04-16 02:24:29 +08:00
|
|
|
"<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>"
|
|
|
|
ORIG "${ORIG}")
|
|
|
|
else()
|
|
|
|
string(REGEX REPLACE
|
2019-11-20 14:21:43 +08:00
|
|
|
"<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>"
|
2017-04-16 02:24:29 +08:00
|
|
|
"<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>"
|
|
|
|
ORIG "${ORIG}")
|
|
|
|
string(REGEX REPLACE
|
2019-11-20 14:21:43 +08:00
|
|
|
"<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>"
|
2017-04-16 02:24:29 +08:00
|
|
|
"<RuntimeLibrary>MultiThreaded</RuntimeLibrary>"
|
|
|
|
ORIG "${ORIG}")
|
|
|
|
endif()
|
2019-11-20 14:21:43 +08:00
|
|
|
if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic")
|
|
|
|
string(REPLACE
|
|
|
|
"<ConfigurationType>StaticLibrary</ConfigurationType>"
|
|
|
|
"<ConfigurationType>DynamicLibrary</ConfigurationType>"
|
|
|
|
ORIG "${ORIG}")
|
|
|
|
else()
|
|
|
|
string(REPLACE
|
|
|
|
"<ConfigurationType>DynamicLibrary</ConfigurationType>"
|
|
|
|
"<ConfigurationType>StaticLibrary</ConfigurationType>"
|
|
|
|
ORIG "${ORIG}")
|
|
|
|
endif()
|
2020-12-30 08:07:42 +08:00
|
|
|
|
|
|
|
string(REPLACE
|
|
|
|
"<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>"
|
|
|
|
"<DebugInformationFormat>OldStyle</DebugInformationFormat>"
|
|
|
|
ORIG "${ORIG}")
|
2017-04-16 02:24:29 +08:00
|
|
|
file(WRITE ${VCXPROJ_PATH} "${ORIG}")
|
|
|
|
endfunction()
|
|
|
|
|
2021-09-21 01:02:13 +08:00
|
|
|
FIX_VCXPROJ("${SOURCE_PATH}/mDNSWindows/DLL/dnssd.vcxproj")
|
2023-01-12 14:45:12 +08:00
|
|
|
if(${VCPKG_CRT_LINKAGE} STREQUAL "dynamic" AND ${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
|
|
|
|
FIX_VCXPROJ("${SOURCE_PATH}/mDNSWindows/DLLStub/DLLStub.vcxproj")
|
|
|
|
endif()
|
2021-09-21 01:02:13 +08:00
|
|
|
FIX_VCXPROJ("${SOURCE_PATH}/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj")
|
2017-04-16 02:24:29 +08:00
|
|
|
|
2023-01-12 14:45:12 +08:00
|
|
|
vcpkg_install_msbuild(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
PROJECT_SUBPATH "mDNSWindows/mDNSResponder.sln"
|
|
|
|
PLATFORM ${BUILD_ARCH}
|
|
|
|
TARGET dns-sd
|
|
|
|
SKIP_CLEAN
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
|
|
|
|
2023-01-12 14:45:12 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/mDNSShared/dns_sd.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2023-01-12 14:45:12 +08:00
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|