Windows: Use a c-ares DLL built with vcpkg.

Update the Windows build environment to use c-ares packages built from
a VS 2017 command prompt with

    set CARES_VERSION=1.15.0
    vcpkg install c-ares:x86-windows c-ares:x64-windows
    vcpkg export c-ares:x86-windows --output=c-ares-%CARES_VERSION%-win32ws --zip
    vcpkg export c-ares:x64-windows --output=c-ares-%CARES_VERSION%-win64ws --zip

The packages also include a PDB, so  copy it to the build directory and
add it to the PDB .zip.

Change-Id: I1887ca89d897bea184144315219b366096519961
Reviewed-on: https://code.wireshark.org/review/31376
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2019-01-04 10:14:13 -08:00
parent 33a8f5e7e6
commit 7fa8215feb
4 changed files with 30 additions and 9 deletions

View File

@ -1751,13 +1751,15 @@ if(WIN32)
WORKING_DIRECTORY "${GLIB2_DLL_DIR}"
)
# Optional DLLs.
# Optional DLLs and PDBs.
set (OPTIONAL_DLLS)
set (OPTIONAL_PDBS)
if (AIRPCAP_FOUND)
list (APPEND OPTIONAL_DLLS "${AIRPCAP_DLL_DIR}/${AIRPCAP_DLL}")
endif(AIRPCAP_FOUND)
if (CARES_FOUND)
list (APPEND OPTIONAL_DLLS "${CARES_DLL_DIR}/${CARES_DLL}")
list (APPEND OPTIONAL_PDBS "${CARES_DLL_DIR}/${CARES_PDB}")
endif(CARES_FOUND)
if (MAXMINDDB_FOUND)
list (APPEND OPTIONAL_DLLS "${MAXMINDDB_DLL_DIR}/${MAXMINDDB_DLL}")
@ -1855,6 +1857,15 @@ if(WIN32)
install(FILES ${OPTIONAL_DLLS} DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif(OPTIONAL_DLLS)
if (OPTIONAL_PDBS)
add_custom_command(TARGET copy_cli_dlls PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${OPTIONAL_PDBS}
"${_dll_output_dir}"
VERBATIM
)
endif(OPTIONAL_PDBS)
add_dependencies(epan copy_cli_dlls)
# We have a lot of choices for creating zip archives:

View File

@ -45,13 +45,18 @@ IF(CARES_FOUND)
CACHE PATH "Path to C-Ares DLL"
)
file( GLOB _cares_dll RELATIVE "${CARES_DLL_DIR}"
"${CARES_DLL_DIR}/libcares-*.dll"
"${CARES_DLL_DIR}/cares.dll"
)
set ( CARES_DLL ${_cares_dll}
# We're storing filenames only. Should we use STRING instead?
CACHE FILEPATH "C-Ares DLL file name"
)
mark_as_advanced( CARES_DLL_DIR CARES_DLL )
file( GLOB _cares_pdb RELATIVE "${CARES_DLL_DIR}"
"${CARES_DLL_DIR}/cares.pdb"
)
set ( CARES_PDB ${_cares_pdb}
CACHE FILEPATH "C-Ares PDB file name"
)
mark_as_advanced( CARES_DLL_DIR CARES_DLL CARES_PDB )
endif()
ELSE(CARES_FOUND)
SET( CARES_LIBRARIES )

View File

@ -23,7 +23,12 @@ function( FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR )
foreach( _DIR ${_SUBDIR} )
if( IS_DIRECTORY ${_DIR} )
if( "${_DIR}" MATCHES ".*/${_WS_LIB_SEARCH_PATH}" )
set( ${_LIB_HINT_VAR} ${_DIR} PARENT_SCOPE )
set(_vcpkg_dir "${_DIR}/installed/$ENV{PLATFORM}-windows")
if( IS_DIRECTORY "${_vcpkg_dir}")
set( ${_LIB_HINT_VAR} ${_vcpkg_dir} PARENT_SCOPE )
else()
set( ${_LIB_HINT_VAR} ${_DIR} PARENT_SCOPE )
endif()
endif()
endif()
endforeach()

View File

@ -69,14 +69,14 @@ Param(
# trouble instead of trying to catch exceptions everywhere.
$ErrorActionPreference = "Stop"
$Win64CurrentTag = "2019-01-02"
$Win32CurrentTag = "2019-01-02"
$Win64CurrentTag = "2019-01-04"
$Win32CurrentTag = "2019-01-04"
# Archive file / SHA256
$Win64Archives = @{
"AirPcap_Devpack_4_1_0_1622.zip" = "09d637f28a79b1d2ecb09f35436271a90c0f69bd0a1ee82b803abaaf63c18a69";
"bcg729-1.0.4-win64ws.zip" = "9a095fda4c39860d96f0c568830faa6651cd17635f68e27aa6de46c689aa0ee2";
"c-ares-1.14.0-win64ws.zip" = "91b1e1460bda513375910977a3410afd024575eebc528adecf3abea7814c0ef1";
"c-ares-1.15.0-win64ws.zip" = "ade864fd08e887d353a9c939fa6e68b0bf3e08761b6e81f60ce15e6543256552";
"gnutls-3.6.3-1-win64ws.zip" = "994ac2578e7b4ca01e589ab2598927d53f7370bc3ff679f3006b0e6bb7a06df4";
"glib2-2.52.2-1.31-win64ws.zip" = "e19a7812db6715c632a5bbf96452ab474a4eaf0c6aaee999323ac7beb7ebe6db";
"kfw-3-2-2-x64-ws.zip" = "91654ffe0b6d418b369c95bc060414a90f91627e55c19a3e753803c9deb2fe9a";
@ -99,7 +99,7 @@ $Win64Archives = @{
$Win32Archives = @{
"AirPcap_Devpack_4_1_0_1622.zip" = "09d637f28a79b1d2ecb09f35436271a90c0f69bd0a1ee82b803abaaf63c18a69";
"bcg729-1.0.4-win32ws.zip" = "b785ec78dec6bca8252130eb884bfa28c1140001dd7369a535579176de9e4271";
"c-ares-1.14.0-win32ws.zip" = "7355f3ad6d6ec05541c59e5b398b8dbd9a41bf6776b26d9656d8d54ecd58178e";
"c-ares-1.15.0-win32ws.zip" = "a54151203a631b478470aaa21b3a1fde6178f2fea9f15a1a6da4bfcecc92cfcd";
"gnutls-3.6.3-1-win32ws.zip" = "42d8313ffb888f525d6c39330c39bcc2182e68ee8433a09dd85e1f1e1474f592";
"glib2-2.52.2-1.34-win32ws.zip" = "28c426a7b64c1cd5b058c2f25685ddfaebca29083bd8f94fec2a8910ece6faf0";
"kfw-3-2-2-i386-ws-vc6.zip" = "527deb2cf1c3ba0cf743f2b9b8011a22096b54f7ce62fc7ba31b520bbac0e802";