mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
pcre.cmake: always check the library with check_library_exists()
even if pkg-config has it. otherwise build dependencies aren't detected.
This commit is contained in:
parent
b2ebe1cb7b
commit
566c22e814
1 changed files with 3 additions and 6 deletions
|
@ -81,18 +81,15 @@ MACRO (CHECK_PCRE)
|
|||
FIND_PACKAGE(PkgConfig QUIET)
|
||||
PKG_CHECK_MODULES(PCRE libpcre2-8)
|
||||
# in case pkg-config or libpcre2-8.pc is not installed:
|
||||
IF(NOT PCRE_FOUND)
|
||||
UNSET(PCRE_FOUND CACHE)
|
||||
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "" PCRE_FOUND)
|
||||
ENDIF()
|
||||
CHECK_LIBRARY_EXISTS(pcre2-8 pcre2_match_8 "${PCRE_LIBRARY_DIRS}" HAVE_PCRE2_MATCH_8)
|
||||
ENDIF()
|
||||
IF(NOT PCRE_FOUND OR WITH_PCRE STREQUAL "bundled")
|
||||
IF(NOT HAVE_PCRE2_MATCH_8 OR WITH_PCRE STREQUAL "bundled")
|
||||
IF (WITH_PCRE STREQUAL "system")
|
||||
MESSAGE(FATAL_ERROR "system pcre2-8 library is not found or unusable")
|
||||
ENDIF()
|
||||
BUNDLE_PCRE2()
|
||||
ELSE()
|
||||
CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "" NEEDS_PCRE2_DEBIAN_HACK)
|
||||
CHECK_LIBRARY_EXISTS(pcre2-posix PCRE2regcomp "${PCRE_LIBRARY_DIRS}" NEEDS_PCRE2_DEBIAN_HACK)
|
||||
IF(NEEDS_PCRE2_DEBIAN_HACK)
|
||||
SET(PCRE2_DEBIAN_HACK "-Dregcomp=PCRE2regcomp -Dregexec=PCRE2regexec -Dregerror=PCRE2regerror -Dregfree=PCRE2regfree")
|
||||
ENDIF()
|
||||
|
|
Loading…
Reference in a new issue