2017-10-05 11:31:35 +08:00
|
|
|
# PCRE2 needs some settings.
|
|
|
|
SET(PCRE2_WIDTH ${WCHAR_T_BITS})
|
|
|
|
SET(PCRE2_BUILD_PCRE2_8 OFF CACHE BOOL "Build 8bit PCRE2 library")
|
|
|
|
SET(PCRE2_BUILD_PCRE2_${PCRE2_WIDTH} ON CACHE BOOL "Build ${PCRE2_WIDTH}bit PCRE2 library")
|
|
|
|
SET(PCRE2_SHOW_REPORT OFF CACHE BOOL "Show the final configuration report")
|
Take an axe to vendored PCRE2 bits & update it to 10.34
This commit updates PCRE2 to 10.34, and we no longer include what's in their
tarball as-is. I've yanked out a lot of uneccessary stuff for the sake of the
size of our codebase.
original pcre2-10.34 dir: 11.5MB
pcre2 dir in this commit: 1.6MB
* Remove documentation, makefiles, test suites, etc. LICENSE remains.
* Disable building tests when configuring PCRE2
* Yard out JIT support: delete src/jit, src/pcre2_jit_*.c, and code doing
stuff to code->executable_jit that needs a jit header (it was already NULL
because we've always built with JIT disabled).
* Remove most .c and .h files not needed to compile: pcre2grep code,
pcre2test code, dftables.c, pcre2_printint.c, pcre2_fuzzsupport.c ...
* Remove FindBZip2, FindZLIB, FindReadline, FindEditline. These were used
only by pcre2grep and made CMake's report misleading with regard to
optional packages being used.
* Remove configure.ac except for version number and date which CMake checks
Next time we update PCRE2, refer to this commit message as well as a diff
between pcre2-10.34.tar.gz and ./pcre2-10.34/. Or better yet, cease including
pcre2.
2020-02-18 21:07:45 +08:00
|
|
|
SET(PCRE2_BUILD_TESTS OFF CACHE BOOL "Build tests")
|
2017-10-05 11:31:35 +08:00
|
|
|
SET(PCRE2_BUILD_PCRE2GREP OFF CACHE BOOL "Build pcre2grep")
|
|
|
|
|
|
|
|
SET(PCRE2_MIN_VERSION 10.21)
|
2020-02-13 06:54:28 +08:00
|
|
|
IF (NOT APPLE)
|
|
|
|
FIND_LIBRARY(PCRE2_LIB pcre2-${PCRE2_WIDTH})
|
|
|
|
FIND_PATH(PCRE2_INCLUDE_DIR pcre2.h)
|
|
|
|
ENDIF()
|
2017-10-05 11:31:35 +08:00
|
|
|
IF (PCRE2_LIB AND PCRE2_INCLUDE_DIR)
|
|
|
|
MESSAGE(STATUS "Found system PCRE2 library ${PCRE2_INCLUDE_DIR}")
|
|
|
|
ELSE()
|
|
|
|
MESSAGE(STATUS "Using bundled PCRE2 library")
|
2020-02-20 08:41:26 +08:00
|
|
|
ADD_SUBDIRECTORY(pcre2 EXCLUDE_FROM_ALL)
|
|
|
|
SET(PCRE2_INCLUDE_DIR ${CMAKE_BINARY_DIR}/pcre2)
|
2017-10-05 11:31:35 +08:00
|
|
|
SET(PCRE2_LIB pcre2-${PCRE2_WIDTH})
|
2020-02-13 06:54:28 +08:00
|
|
|
ENDIF(PCRE2_LIB AND PCRE2_INCLUDE_DIR)
|
2017-10-05 11:31:35 +08:00
|
|
|
INCLUDE_DIRECTORIES(${PCRE2_INCLUDE_DIR})
|