2021-09-21 01:02:13 +08:00
|
|
|
vcpkg_fail_port_install(ON_ARCH "arm")
|
|
|
|
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2021-09-21 01:02:13 +08:00
|
|
|
URLS https://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-878.270.2.tar.gz
|
|
|
|
FILENAME mDNSResponder-878.270.2.tar.gz
|
|
|
|
SHA512 dbc1805c757fceb2b37165ad2575e4084447c10f47ddc871f5476e25affd91f5f759662c17843e30857a9ea1ffd25132bc8012737cf22700ac329713e6a3ac0a
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
2019-10-08 01:35:13 +08:00
|
|
|
|
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE ${ARCHIVE}
|
|
|
|
)
|
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")
|
|
|
|
FIX_VCXPROJ("${SOURCE_PATH}/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj")
|
2017-04-16 02:24:29 +08:00
|
|
|
|
|
|
|
vcpkg_build_msbuild(
|
2021-09-21 01:02:13 +08:00
|
|
|
PROJECT_PATH "${SOURCE_PATH}/mDNSResponder.sln"
|
2017-04-16 02:24:29 +08:00
|
|
|
PLATFORM ${BUILD_ARCH}
|
|
|
|
TARGET dns-sd
|
|
|
|
)
|
|
|
|
|
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
|
|
|
file(INSTALL
|
2021-09-21 01:02:13 +08:00
|
|
|
"${SOURCE_PATH}/mDNSWindows/DLL/${BUILD_ARCH}/Release/dnssd.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/bin"
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
|
|
|
file(INSTALL
|
2021-09-21 01:02:13 +08:00
|
|
|
"${SOURCE_PATH}/mDNSWindows/DLL/${BUILD_ARCH}/Debug/dnssd.dll"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin"
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
file(INSTALL
|
2021-09-21 01:02:13 +08:00
|
|
|
"${SOURCE_PATH}/mDNSWindows/DLL/${BUILD_ARCH}/Release/dnssd.lib"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/lib"
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
|
|
|
file(INSTALL
|
2021-09-21 01:02:13 +08:00
|
|
|
"${SOURCE_PATH}/mDNSWindows/DLL/${BUILD_ARCH}/Debug/dnssd.lib"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib"
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
|
|
|
file(INSTALL
|
2021-09-21 01:02:13 +08:00
|
|
|
"${SOURCE_PATH}/mDNSShared/dns_sd.h"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/include"
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
|
|
|
file(INSTALL
|
2021-09-21 01:02:13 +08:00
|
|
|
"${SOURCE_PATH}/LICENSE"
|
|
|
|
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright"
|
2017-04-16 02:24:29 +08:00
|
|
|
)
|
2019-10-08 01:35:13 +08:00
|
|
|
vcpkg_copy_pdbs()
|