Skip to content

Commit 5a23496

Browse files
committed
re2 is a dependency of protobuf
1 parent b68183d commit 5a23496

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ message(STATUS "Build ZLIB: ${BUILD_ZLIB}")
8585
option(BUILD_absl "Build the abseil-cpp dependency Library" ON)
8686
message(STATUS "Build abseil-cpp: ${BUILD_absl}")
8787

88+
option(BUILD_re2 "Build the RE2 dependency Library" ON)
89+
message(STATUS "Build re2: ${BUILD_re2}")
90+
8891
option(BUILD_Protobuf "Build the Protobuf dependency Library" ON)
8992
message(STATUS "Build protobuf: ${BUILD_Protobuf}")
9093

91-
option(BUILD_re2 "Build the re2 dependency Library" ON)
92-
message(STATUS "Build re2: ${BUILD_re2}")
93-
9494
if(BUILD_TESTING)
9595
option(BUILD_googletest "Build googletest" ON)
9696
option(BUILD_benchmark "Build benchmark" ON)

cmake/dependencies/CMakeLists.txt

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ if(BUILD_absl)
5858
message(CHECK_PASS "fetched")
5959
endif()
6060

61+
# ##############################################################################
62+
# RE2
63+
# ##############################################################################
64+
if(BUILD_re2)
65+
message(CHECK_START "Fetching re2")
66+
list(APPEND CMAKE_MESSAGE_INDENT " ")
67+
FetchContent_Declare(
68+
re2
69+
GIT_REPOSITORY "https://github.com/google/re2.git"
70+
GIT_TAG "2025-08-12"
71+
GIT_SHALLOW TRUE
72+
UPDATE_COMMAND git reset --hard
73+
PATCH_COMMAND git apply --ignore-whitespace
74+
"${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2025-08-12.patch"
75+
)
76+
set(RE2_BUILD_TESTING OFF)
77+
FetchContent_MakeAvailable(re2)
78+
list(POP_BACK CMAKE_MESSAGE_INDENT)
79+
message(CHECK_PASS "fetched")
80+
endif()
81+
6182
# ##############################################################################
6283
# Protobuf
6384
# ##############################################################################
@@ -84,27 +105,6 @@ if(BUILD_Protobuf)
84105
message(CHECK_PASS "fetched")
85106
endif()
86107

87-
# ##############################################################################
88-
# RE2
89-
# ##############################################################################
90-
if(BUILD_re2)
91-
message(CHECK_START "Fetching re2")
92-
list(APPEND CMAKE_MESSAGE_INDENT " ")
93-
FetchContent_Declare(
94-
re2
95-
GIT_REPOSITORY "https://github.com/google/re2.git"
96-
GIT_TAG "2025-08-12"
97-
GIT_SHALLOW TRUE
98-
UPDATE_COMMAND git reset --hard
99-
PATCH_COMMAND git apply --ignore-whitespace
100-
"${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2025-08-12.patch"
101-
)
102-
set(RE2_BUILD_TESTING OFF)
103-
FetchContent_MakeAvailable(re2)
104-
list(POP_BACK CMAKE_MESSAGE_INDENT)
105-
message(CHECK_PASS "fetched")
106-
endif()
107-
108108
###############
109109
## TESTING ##
110110
###############

0 commit comments

Comments
 (0)