Skip to content

Commit

Permalink
Update PCRE version to 8.42 (8.41 is also compatible)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatchanghao committed Jan 21, 2019
1 parent c06d5e1 commit f13cbd6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ set(PCRE_REQUIRED_MINOR_VERSION 41)
set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION})
include (${CMAKE_MODULE_PATH}/pcre.cmake)
if (NOT CORRECT_PCRE_VERSION)
message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} not found")
message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found")
endif()

# we need static libs for Chimera - too much deep magic for shared libs
Expand Down Expand Up @@ -508,7 +508,7 @@ set(PCRE_REQUIRED_MINOR_VERSION 41)
set(PCRE_REQUIRED_VERSION ${PCRE_REQUIRED_MAJOR_VERSION}.${PCRE_REQUIRED_MINOR_VERSION})
include (${CMAKE_MODULE_PATH}/pcre.cmake)
if (NOT CORRECT_PCRE_VERSION)
message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} not found")
message(STATUS "PCRE ${PCRE_REQUIRED_VERSION} or above not found")
endif()

# we need static libs for Chimera - too much deep magic for shared libs
Expand Down
12 changes: 6 additions & 6 deletions cmake/pcre.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ if (PCRE_BUILD_SOURCE)

# first, check version number
CHECK_C_SOURCE_COMPILES("#include <pcre.h.generic>
#if PCRE_MAJOR != ${PCRE_REQUIRED_MAJOR_VERSION} || PCRE_MINOR != ${PCRE_REQUIRED_MINOR_VERSION}
#if PCRE_MAJOR != ${PCRE_REQUIRED_MAJOR_VERSION} || PCRE_MINOR < ${PCRE_REQUIRED_MINOR_VERSION}
#error Incorrect pcre version
#endif
main() {}" CORRECT_PCRE_VERSION)
set (CMAKE_REQUIRED_INCLUDES "${saved_INCLUDES}")

if (NOT CORRECT_PCRE_VERSION)
unset(CORRECT_PCRE_VERSION CACHE)
message(STATUS "Incorrect version of pcre - version ${PCRE_REQUIRED_VERSION} is required")
message(STATUS "Incorrect version of pcre - version ${PCRE_REQUIRED_VERSION} or above is required")
return ()
else()
message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} - building from source.")
message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above - building from source.")
endif()

# PCRE compile options
Expand All @@ -52,12 +52,12 @@ if (PCRE_BUILD_SOURCE)
else ()
# pkgconf should save us
find_package(PkgConfig)
pkg_check_modules(PCRE libpcre=${PCRE_REQUIRED_VERSION})
pkg_check_modules(PCRE libpcre>=${PCRE_REQUIRED_VERSION})
if (PCRE_FOUND)
set(CORRECT_PCRE_VERSION TRUE)
message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION}")
message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above")
else ()
message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} not found")
message(STATUS "PCRE version ${PCRE_REQUIRED_VERSION} or above not found")
return ()
endif ()
endif (PCRE_BUILD_SOURCE)
2 changes: 1 addition & 1 deletion doc/dev-reference/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ libpcre are supported. The use of unsupported constructs will result in
compilation errors.

The version of PCRE used to validate Hyperscan's interpretation of this syntax
is 8.41.
is 8.41 or above.

====================
Supported Constructs
Expand Down

0 comments on commit f13cbd6

Please sign in to comment.