aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2023-10-17 19:11:26 -0700
committerGerald Combs <gerald@wireshark.org>2023-10-19 18:05:43 -0700
commit800831cab2d20722b042e2847bff965f51714bad (patch)
treedbc460c326b574efb6f746f0465a4f9fdaae810f /cmake/modules
parent652b6b186f4d334846e99666c31dea68d9073251 (diff)
Fixup vcpkg-export-20231017-1
GLib's debug libraries link against pcre2-8d.lib, which means we have to as well. Revert some debugging in GitLab CI.
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindGLIB2.cmake12
-rw-r--r--cmake/modules/FindPCRE2.cmake86
2 files changed, 59 insertions, 39 deletions
diff --git a/cmake/modules/FindGLIB2.cmake b/cmake/modules/FindGLIB2.cmake
index 79e8abd29a..6b3876b528 100644
--- a/cmake/modules/FindGLIB2.cmake
+++ b/cmake/modules/FindGLIB2.cmake
@@ -142,11 +142,6 @@ if( GLIB2_FOUND )
# "${GLIB2_DLL_DIR_RELEASE}/libffi.dll"
"${GLIB2_DLL_DIR_RELEASE}/iconv-2.dll"
"${GLIB2_DLL_DIR_RELEASE}/intl-8.dll"
- "${GLIB2_DLL_DIR_RELEASE}/pcre.dll"
- # "${GLIB2_DLL_DIR_RELEASE}/pcre16.dll"
- # "${GLIB2_DLL_DIR_RELEASE}/pcre32.dll"
- # "${GLIB2_DLL_DIR_RELEASE}/pcrecpp.dll"
- # "${GLIB2_DLL_DIR_RELEASE}/pcreposix.dll"
)
set ( GLIB2_DLLS_RELEASE ${_glib2_dlls_release}
# We're storing filenames only. Should we use STRING instead?
@@ -163,11 +158,6 @@ if( GLIB2_FOUND )
# "${GLIB2_DLL_DIR_DEBUG}/libffi.dll"
"${GLIB2_DLL_DIR_DEBUG}/iconv-2.dll"
"${GLIB2_DLL_DIR_DEBUG}/intl-8.dll"
- "${GLIB2_DLL_DIR_DEBUG}/pcred.dll"
- # "${GLIB2_DLL_DIR_DEBUG}/pcre16d.dll"
- # "${GLIB2_DLL_DIR_DEBUG}/pcre32d.dll"
- # "${GLIB2_DLL_DIR_DEBUG}/pcrecppd.dll"
- # "${GLIB2_DLL_DIR_DEBUG}/pcreposixd.dll"
)
set ( GLIB2_DLLS_DEBUG ${_glib2_dlls_debug}
# We're storing filenames only. Should we use STRING instead?
@@ -181,7 +171,6 @@ if( GLIB2_FOUND )
# "${GLIB2_DLL_DIR_RELEASE}/libcharset.pdb"
# "${GLIB2_DLL_DIR_RELEASE}/libiconv.pdb"
# "${GLIB2_DLL_DIR_RELEASE}/libintl.pdb"
- "${GLIB2_DLL_DIR_RELEASE}/pcre.pdb"
)
set ( GLIB2_PDBS_RELEASE ${_glib2_pdbs_release}
CACHE FILEPATH "GLib2 debug release PDB list"
@@ -193,7 +182,6 @@ if( GLIB2_FOUND )
# "${GLIB2_DLL_DIR_DEBUG}/libcharset.pdb"
# "${GLIB2_DLL_DIR_DEBUG}/libiconv.pdb"
# "${GLIB2_DLL_DIR_DEBUG}/libintl.pdb"
- "${GLIB2_DLL_DIR_DEBUG}/pcre.pdb"
)
set ( GLIB2_PDBS_DEBUG ${_glib2_pdbs_debug}
CACHE FILEPATH "GLib2 debug debug PDB list"
diff --git a/cmake/modules/FindPCRE2.cmake b/cmake/modules/FindPCRE2.cmake
index fb9b827d24..a7d80792b5 100644
--- a/cmake/modules/FindPCRE2.cmake
+++ b/cmake/modules/FindPCRE2.cmake
@@ -1,17 +1,20 @@
#
# - Find PCRE2 libraries
#
-# PCRE2_INCLUDE_DIRS - where to find PCRE2 headers.
-# PCRE2_LIBRARIES - List of libraries when using PCRE2.
-# PCRE2_FOUND - True if PCRE2 is found.
-# PCRE2_DLL_DIR - (Windows) Path to the PCRE2 DLL
-# PCRE2_DLL - (Windows) Name of the PCRE2 DLL
+# PCRE2_INCLUDE_DIRS - where to find PCRE2 headers.
+# PCRE2_LIBRARIES - List of libraries when using PCRE2.
+# PCRE2_FOUND - True if PCRE2 is found.
+# PCRE2_RELEASE_DLL_DIR - (Windows) Path to the PCRE2 release DLL
+# PCRE2_RELEASE_DLL - (Windows) Name of the PCRE2 release DLL
+# PCRE2_DEBUG_DLL_DIR - (Windows) Path to the PCRE2 debug DLL
+# PCRE2_DEBUG_DLL - (Windows) Name of the PCRE2 debug DLL
# Note that the "8" in "libpcre2-8" refers to "PCRE library version 2 with
# support for 8-bit code units".
include( FindWSWinLibs )
-FindWSWinLibs( "pcre2-.*" "PCRE2_HINTS" )
+# PCRE2 is included with GLib2
+FindWSWinLibs( "vcpkg-export-.*" "PCRE2_HINTS" )
if( NOT USE_REPOSITORY)
find_package(PkgConfig QUIET)
@@ -28,12 +31,23 @@ find_path(PCRE2_INCLUDE_DIR
find_library(PCRE2_LIBRARY
NAMES
- "pcre2-8"
+ pcre2-8
HINTS
${PC_PCRE2_LIBRARY_DIRS}
${PCRE2_HINTS}/lib
)
+if (USE_REPOSITORY)
+ find_library(PCRE2_DEBUG_LIBRARY
+ NAMES
+ pcre2-8d
+ HINTS
+ ${PCRE2_HINTS}/debug/lib
+ )
+else()
+ set (PCRE2_DEBUG_LIBRARY ${PCRE2_LIBRARY} CACHE FILEPATH "PCRE2 library")
+endif()
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCRE2
REQUIRED_VARS PCRE2_LIBRARY PCRE2_INCLUDE_DIR
@@ -42,27 +56,45 @@ find_package_handle_standard_args(PCRE2
if(PCRE2_FOUND)
set(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
+ set(PCRE2_DEBUG_LIBRARIES ${PCRE2_DEBUG_LIBRARY})
set(PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR})
- if (WIN32)
- set (PCRE2_DLL_DIR "${PCRE2_HINTS}/bin"
- CACHE PATH "Path to PCRE2 DLL"
- )
- file(GLOB _pcre2_dll RELATIVE "${PCRE2_DLL_DIR}"
- "${PCRE2_DLL_DIR}/pcre2-8*.dll"
- )
- set (PCRE2_DLL ${_pcre2_dll}
- # We're storing filenames only. Should we use STRING instead?
- CACHE FILEPATH "PCRE2 DLL file name"
- )
- file(GLOB _pcre2_pdb RELATIVE "${PCRE2_DLL_DIR}"
- "${PCRE2_DLL_DIR}/pcre2-8*.pdb"
- )
- set (PCRE2_PDB ${_pcre2_pdb}
- CACHE FILEPATH "PCRE2 PDB file name"
- )
- mark_as_advanced(PCRE2_DLL_DIR PCRE2_DLL PCRE2_PDB)
- endif()
- else()
+ if (USE_REPOSITORY)
+ set (PCRE2_RELEASE_DLL_DIR "${PCRE2_HINTS}/bin"
+ CACHE PATH "Path to PCRE2 release DLL"
+ )
+ file(GLOB _pcre2_release_dll RELATIVE "${PCRE2_RELEASE_DLL_DIR}"
+ "${PCRE2_RELEASE_DLL_DIR}/pcre2-8*.dll"
+ )
+ set (PCRE2_RELEASE_DLL ${_pcre2_release_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "PCRE2 release DLL file name"
+ )
+ file(GLOB _pcre2_release_pdb RELATIVE "${PCRE2_RELEASE_DLL_DIR}"
+ "${PCRE2_RELEASE_DLL_DIR}/pcre2-8*.pdb"
+ )
+ set (PCRE2_RELEASE_PDB ${_pcre2_release_pdb}
+ CACHE FILEPATH "PCRE2 release PDB file name"
+ )
+
+ set (PCRE2_DEBUG_DLL_DIR "${PCRE2_HINTS}/debug/bin"
+ CACHE PATH "Path to PCRE2 debug DLL"
+ )
+ file(GLOB _pcre2_debug_dll RELATIVE "${PCRE2_DEBUG_DLL_DIR}"
+ "${PCRE2_DEBUG_DLL_DIR}/pcre2-8d*.dll"
+ )
+ set (PCRE2_DEBUG_DLL ${_pcre2_debug_dll}
+ # We're storing filenames only. Should we use STRING instead?
+ CACHE FILEPATH "PCRE2 debug DLL file name"
+ )
+ file(GLOB _pcre2_debug_pdb RELATIVE "${PCRE2_DEBUG_DLL_DIR}"
+ "${PCRE2_DEBUG_DLL_DIR}/pcre2-8d*.pdb"
+ )
+ set (PCRE2_DEBUG_PDB ${_pcre2_debug_pdb}
+ CACHE FILEPATH "PCRE2 debug PDB file name"
+ )
+ mark_as_advanced(PCRE2_RELEASE_DLL_DIR PCRE2_RELEASE_DLL PCRE2_PDB PCRE2_DEBUG_DLL_DIR PCRE2_DEBUG_DLL)
+ endif()
+else()
set(PCRE2_LIBRARIES)
set(PCRE2_INCLUDE_DIRS)
endif()