From b4ee1a289a6c184bd8ec4bbd98ff0183a44e7dfe Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Wed, 20 Nov 2019 07:21:43 +0100 Subject: mdnsresponder: fix build with dynamic CRT mdnsresponder was being built with static CRT even when VCPKG_CRT_LINKAGE was set to "dynamic": -- Performing post-build validation Expected Debug,Dynamic crt linkage, but the following libs had invalid crt linkage: C:/vcpkg/packages/mdnsresponder_x64-windows-static-md/debug/lib/dnssd.lib: Debug,Static To inspect the lib files, use: dumpbin.exe /directives mylibfile.lib Expected Release,Dynamic crt linkage, but the following libs had invalid crt linkage: C:/vcpkg/packages/mdnsresponder_x64-windows-static-md/lib/dnssd.lib: Release,Static To inspect the lib files, use: dumpbin.exe /directives mylibfile.lib Found 2 error(s). Please correct the portfile: C:\vcpkg\ports\mdnsresponder\portfile.cmake -- Performing post-build validation done Error: Building package mdnsresponder:x64-windows-static-md failed with: POST_BUILD_CHECKS_FAILED --- ports/mdnsresponder/CONTROL | 2 +- ports/mdnsresponder/portfile.cmake | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/ports/mdnsresponder/CONTROL b/ports/mdnsresponder/CONTROL index a94e7866c..66c039dbc 100644 --- a/ports/mdnsresponder/CONTROL +++ b/ports/mdnsresponder/CONTROL @@ -1,4 +1,4 @@ Source: mdnsresponder -Version: 765.30.11-1 +Version: 765.30.11-2 Description: The mDNSResponder project is a component of Bonjour, Apple's ease-of-use IP networking initiative. Homepage: https://developer.apple.com/bonjour/ diff --git a/ports/mdnsresponder/portfile.cmake b/ports/mdnsresponder/portfile.cmake index 46ab04ddb..c37b07a20 100644 --- a/ports/mdnsresponder/portfile.cmake +++ b/ports/mdnsresponder/portfile.cmake @@ -21,33 +21,36 @@ ENDIF() function(FIX_VCXPROJ VCXPROJ_PATH) file(READ ${VCXPROJ_PATH} ORIG) - if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - string(REPLACE - "StaticLibrary" - "DynamicLibrary" - ORIG "${ORIG}") + if(${VCPKG_CRT_LINKAGE} STREQUAL "dynamic") string(REGEX REPLACE - "*" + "MultiThreadedDebug" "MultiThreadedDebugDLL" ORIG "${ORIG}") string(REGEX REPLACE - "*" + "MultiThreaded" "MultiThreadedDLL" ORIG "${ORIG}") else() - string(REPLACE - "DynamicLibrary" - "StaticLibrary" - ORIG "${ORIG}") string(REGEX REPLACE - "*Debug" + "MultiThreadedDebugDLL" "MultiThreadedDebug" ORIG "${ORIG}") string(REGEX REPLACE - "*" + "MultiThreadedDLL" "MultiThreaded" ORIG "${ORIG}") endif() + if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "dynamic") + string(REPLACE + "StaticLibrary" + "DynamicLibrary" + ORIG "${ORIG}") + else() + string(REPLACE + "DynamicLibrary" + "StaticLibrary" + ORIG "${ORIG}") + endif() file(WRITE ${VCXPROJ_PATH} "${ORIG}") endfunction() -- cgit v1.2.3