Skip to content

Commit ac2b235

Browse files
committed
regex: use REGEX_BACKEND as the cmake option name
This avoids any misunderstanding with the REGEX keyword in cmake.
1 parent ce6d624 commit ac2b235

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ OPTION(DEBUG_POOL "Enable debug pool allocator" OFF)
6565
OPTION(ENABLE_WERROR "Enable compilation with -Werror" OFF)
6666
OPTION(USE_BUNDLED_ZLIB "Use the bundled version of zlib" OFF)
6767
OPTION(DEPRECATE_HARD "Do not include deprecated functions in the library" OFF)
68-
SET(REGEX "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
68+
SET(REGEX_BACKEND "" CACHE STRING "Regular expression implementation. One of regcomp_l, pcre2, pcre, regcomp, or builtin.")
6969

7070
IF (UNIX AND NOT APPLE)
7171
OPTION(ENABLE_REPRODUCIBLE_BUILDS "Enable reproducible builds" OFF)

src/CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -292,22 +292,22 @@ ENDIF()
292292
# Specify regular expression implementation
293293
FIND_PACKAGE(PCRE)
294294

295-
IF(REGEX STREQUAL "")
295+
IF(REGEX_BACKEND STREQUAL "")
296296
CHECK_SYMBOL_EXISTS(regcomp_l "regex.h;xlocale.h" HAVE_REGCOMP_L)
297297

298298
IF(HAVE_REGCOMP_L)
299-
SET(REGEX "regcomp_l")
299+
SET(REGEX_BACKEND "regcomp_l")
300300
ELSEIF(PCRE_FOUND)
301-
SET(REGEX "pcre")
301+
SET(REGEX_BACKEND "pcre")
302302
ELSE()
303-
SET(REGEX "builtin")
303+
SET(REGEX_BACKEND "builtin")
304304
ENDIF()
305305
ENDIF()
306306

307-
IF(REGEX STREQUAL "regcomp_l")
307+
IF(REGEX_BACKEND STREQUAL "regcomp_l")
308308
ADD_FEATURE_INFO(regex ON "using system regcomp_l")
309309
SET(GIT_REGEX_REGCOMP_L 1)
310-
ELSEIF(REGEX STREQUAL "pcre2")
310+
ELSEIF(REGEX_BACKEND STREQUAL "pcre2")
311311
FIND_PACKAGE(PCRE2)
312312

313313
IF(NOT PCRE2_FOUND)
@@ -319,24 +319,24 @@ ELSEIF(REGEX STREQUAL "pcre2")
319319

320320
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE2_INCLUDE_DIRS})
321321
LIST(APPEND LIBGIT2_LIBS ${PCRE2_LIBRARIES})
322-
ELSEIF(REGEX STREQUAL "pcre")
322+
ELSEIF(REGEX_BACKEND STREQUAL "pcre")
323323
ADD_FEATURE_INFO(regex ON "using system PCRE")
324324
SET(GIT_REGEX_PCRE 1)
325325

326326
LIST(APPEND LIBGIT2_SYSTEM_INCLUDES ${PCRE_INCLUDE_DIRS})
327327
LIST(APPEND LIBGIT2_LIBS ${PCRE_LIBRARIES})
328-
ELSEIF(REGEX STREQUAL "regcomp")
328+
ELSEIF(REGEX_BACKEND STREQUAL "regcomp")
329329
ADD_FEATURE_INFO(regex ON "using system regcomp")
330330
SET(GIT_REGEX_REGCOMP 1)
331-
ELSEIF(REGEX STREQUAL "builtin")
331+
ELSEIF(REGEX_BACKEND STREQUAL "builtin")
332332
ADD_FEATURE_INFO(regex ON "using bundled PCRE")
333333
SET(GIT_REGEX_BUILTIN 1)
334334

335335
ADD_SUBDIRECTORY("${libgit2_SOURCE_DIR}/deps/pcre" "${libgit2_BINARY_DIR}/deps/pcre")
336336
LIST(APPEND LIBGIT2_INCLUDES "${libgit2_SOURCE_DIR}/deps/pcre")
337337
LIST(APPEND LIBGIT2_OBJECTS $<TARGET_OBJECTS:pcre>)
338338
ELSE()
339-
MESSAGE(FATAL_ERROR "The REGEX option provided is not supported")
339+
MESSAGE(FATAL_ERROR "The REGEX_BACKEND option provided is not supported")
340340
ENDIF()
341341

342342
# Optional external dependency: http-parser

0 commit comments

Comments
 (0)