Skip to content

Commit 0657d3a

Browse files
committed
cmake: bump deps
1 parent 3e6dd78 commit 0657d3a

7 files changed

Lines changed: 189 additions & 31 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ message(STATUS "Build abseil-cpp: ${BUILD_absl}")
8888
option(BUILD_Protobuf "Build the Protobuf dependency Library" ON)
8989
message(STATUS "Build protobuf: ${BUILD_Protobuf}")
9090

91-
option(BUILD_re2 "Build the re2 dependency Library" ON)
92-
message(STATUS "Build re2: ${BUILD_re2}")
93-
9491
if(BUILD_TESTING)
92+
option(BUILD_re2 "Build the RE2 dependency Library" ON)
9593
option(BUILD_googletest "Build googletest" ON)
9694
option(BUILD_benchmark "Build benchmark" ON)
9795
else()
96+
set(BUILD_re2 OFF)
9897
set(BUILD_googletest OFF)
9998
set(BUILD_benchmark OFF)
10099
endif()
100+
message(STATUS "Build re2: ${BUILD_re2}")
101101
message(STATUS "Build googletest: ${BUILD_googletest}")
102102
message(STATUS "Build benchmark: ${BUILD_benchmark}")
103103

cmake/check_deps.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ endif()
5151

5252
# CXX Test
5353
if(BUILD_TESTING)
54+
if(NOT TARGET GTest::gtest)
55+
message(FATAL_ERROR "Target GTest::gtest not available.")
56+
endif()
5457
if(NOT TARGET GTest::gtest_main)
5558
message(FATAL_ERROR "Target GTest::gtest_main not available.")
5659
endif()

cmake/dependencies/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if(BUILD_ZLIB)
1717
GIT_REPOSITORY "https://github.com/madler/ZLIB.git"
1818
GIT_TAG "v1.3.1"
1919
GIT_SHALLOW TRUE
20+
UPDATE_COMMAND git reset --hard
2021
PATCH_COMMAND git apply --ignore-whitespace
2122
"${CMAKE_CURRENT_LIST_DIR}/../../patches/ZLIB-v1.3.1.patch")
2223
set(ZLIB_BUILD_EXAMPLES OFF)
@@ -34,11 +35,13 @@ if(BUILD_absl)
3435
FetchContent_Declare(
3536
absl
3637
GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git"
37-
GIT_TAG "20250512.1"
38+
GIT_TAG "20250814.0"
3839
GIT_SHALLOW TRUE
40+
UPDATE_COMMAND git reset --hard
3941
PATCH_COMMAND git apply --ignore-whitespace
40-
"${CMAKE_CURRENT_LIST_DIR}/../../patches/abseil-cpp-20250512.1.patch"
41-
OVERRIDE_FIND_PACKAGE)
42+
"${CMAKE_CURRENT_LIST_DIR}/../../patches/abseil-cpp-20250814.0.patch"
43+
OVERRIDE_FIND_PACKAGE
44+
)
4245
set(ABSL_USE_SYSTEM_INCLUDES ON)
4346
# We want Abseil to declare what C++ standard it was compiled with.
4447
set(ABSL_PROPAGATE_CXX_STD ON)
@@ -60,11 +63,12 @@ if(BUILD_Protobuf)
6063
FetchContent_Declare(
6164
Protobuf
6265
GIT_REPOSITORY "https://github.com/protocolbuffers/protobuf.git"
63-
GIT_TAG "v31.1"
66+
GIT_TAG "v32.0"
6467
GIT_SHALLOW TRUE
6568
GIT_SUBMODULES ""
69+
UPDATE_COMMAND git reset --hard
6670
PATCH_COMMAND git apply --ignore-whitespace
67-
"${CMAKE_CURRENT_LIST_DIR}/../../patches/protobuf-v31.1.patch"
71+
"${CMAKE_CURRENT_LIST_DIR}/../../patches/protobuf-v32.0.patch"
6872
)
6973
set(protobuf_BUILD_TESTS OFF)
7074
set(protobuf_BUILD_SHARED_LIBS ON)
@@ -85,10 +89,11 @@ if(BUILD_re2)
8589
FetchContent_Declare(
8690
re2
8791
GIT_REPOSITORY "https://github.com/google/re2.git"
88-
GIT_TAG "2025-08-12"
92+
GIT_TAG "2024-07-02"
8993
GIT_SHALLOW TRUE
94+
UPDATE_COMMAND git reset --hard
9095
PATCH_COMMAND git apply --ignore-whitespace
91-
"${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2025-08-12.patch"
96+
"${CMAKE_CURRENT_LIST_DIR}/../../patches/re2-2024-07-02.patch"
9297
)
9398
set(RE2_BUILD_TESTING OFF)
9499
FetchContent_MakeAvailable(re2)
@@ -107,12 +112,13 @@ if(BUILD_googletest)
107112
GIT_REPOSITORY https://github.com/google/googletest.git
108113
GIT_TAG v1.17.0
109114
GIT_SHALLOW TRUE
115+
UPDATE_COMMAND git reset --hard
110116
PATCH_COMMAND git apply --ignore-whitespace
111117
"${CMAKE_CURRENT_LIST_DIR}/../../patches/googletest-v1.17.0.patch"
112118
)
113119
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
114-
set(INSTALL_GTEST OFF)
115120
set(GTEST_HAS_ABSL ON)
121+
set(INSTALL_GTEST ON)
116122
FetchContent_MakeAvailable(googletest)
117123
list(POP_BACK CMAKE_MESSAGE_INDENT)
118124
message(CHECK_PASS "fetched")

patches/abseil-cpp-20250512.1.patch

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
2+
index 624a3c7..8d0493d 100644
3+
--- a/CMake/AbseilHelpers.cmake
4+
+++ b/CMake/AbseilHelpers.cmake
5+
@@ -345,7 +345,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
6+
endif()
7+
endif()
8+
9+
- if(ABSL_ENABLE_INSTALL)
10+
+ if(ABSL_ENABLE_INSTALL AND NOT ABSL_CC_LIB_TESTONLY)
11+
install(TARGETS ${_NAME} EXPORT ${PROJECT_NAME}Targets
12+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
13+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
14+
diff --git a/CMakeLists.txt b/CMakeLists.txt
15+
index 1e7c856..a3c3dae 100644
16+
--- a/CMakeLists.txt
17+
+++ b/CMakeLists.txt
18+
@@ -145,7 +145,7 @@ if((BUILD_TESTING AND ABSL_BUILD_TESTING) OR ABSL_BUILD_TEST_HELPERS)
19+
add_library(GTest::gmock ALIAS gmock)
20+
add_library(GTest::gmock_main ALIAS gmock_main)
21+
else()
22+
- message(FATAL_ERROR "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.")
23+
+ message(WARNING "ABSL_USE_EXTERNAL_GOOGLETEST is ON and ABSL_FIND_GOOGLETEST is OFF, which means that the top-level project must build the Google Test project. However, the target gtest was not found.")
24+
endif()
25+
endif()
26+
else()
27+
diff --git a/absl/flags/declare.h b/absl/flags/declare.h
28+
index 8d2a856..a154046 100644
29+
--- a/absl/flags/declare.h
30+
+++ b/absl/flags/declare.h
31+
@@ -59,10 +59,15 @@ ABSL_NAMESPACE_END
32+
33+
// Internal implementation of ABSL_DECLARE_FLAG to allow macro expansion of its
34+
// arguments. Clients must use ABSL_DECLARE_FLAG instead.
35+
+#if defined(_MSC_VER)
36+
+#define ABSL_DECLARE_FLAG_INTERNAL(type, name) \
37+
+ extern absl::Flag<type> FLAGS_##name
38+
+#else
39+
#define ABSL_DECLARE_FLAG_INTERNAL(type, name) \
40+
extern absl::Flag<type> FLAGS_##name; \
41+
namespace absl /* block flags in namespaces */ {} \
42+
/* second redeclaration is to allow applying attributes */ \
43+
extern absl::Flag<type> FLAGS_##name
44+
+#endif // _MSC_VER
45+
46+
#endif // ABSL_FLAGS_DECLARE_H_
47+
diff --git a/absl/log/CMakeLists.txt b/absl/log/CMakeLists.txt
48+
index eb19bec..13b2d24 100644
49+
--- a/absl/log/CMakeLists.txt
50+
+++ b/absl/log/CMakeLists.txt
51+
@@ -47,6 +47,7 @@ absl_cc_library(
52+
absl::base
53+
absl::config
54+
absl::core_headers
55+
+ absl::has_ostream_operator
56+
absl::leak_check
57+
absl::log_internal_nullguard
58+
absl::log_internal_nullstream
59+
diff --git a/absl/log/check_test_impl.inc b/absl/log/check_test_impl.inc
60+
index 5a7caf4..7bcedd4 100644
61+
--- a/absl/log/check_test_impl.inc
62+
+++ b/absl/log/check_test_impl.inc
63+
@@ -13,6 +13,8 @@
64+
// See the License for the specific language governing permissions and
65+
// limitations under the License.
66+
67+
+// SKIP_ABSL_INLINE_NAMESPACE_CHECK
68+
+
69+
#ifndef ABSL_LOG_CHECK_TEST_IMPL_H_
70+
#define ABSL_LOG_CHECK_TEST_IMPL_H_
71+
72+
@@ -241,6 +243,18 @@ TEST(CHECKTest, TestBinaryChecksWithPrimitives) {
73+
ABSL_TEST_CHECK_LT(1, 2);
74+
}
75+
76+
+TEST(CHECKTest, TestBinaryChecksWithStringComparison) {
77+
+ const std::string a = "a";
78+
+ ABSL_TEST_CHECK_EQ(a, "a");
79+
+ ABSL_TEST_CHECK_NE(a, "b");
80+
+ ABSL_TEST_CHECK_GE(a, a);
81+
+ ABSL_TEST_CHECK_GE("b", a);
82+
+ ABSL_TEST_CHECK_LE(a, "a");
83+
+ ABSL_TEST_CHECK_LE(a, "b");
84+
+ ABSL_TEST_CHECK_GT("b", a);
85+
+ ABSL_TEST_CHECK_LT(a, "b");
86+
+}
87+
+
88+
// For testing using CHECK*() on anonymous enums.
89+
enum { CASE_A, CASE_B };
90+
91+
diff --git a/absl/log/internal/BUILD.bazel b/absl/log/internal/BUILD.bazel
92+
index 1ba9d76..005861f 100644
93+
--- a/absl/log/internal/BUILD.bazel
94+
+++ b/absl/log/internal/BUILD.bazel
95+
@@ -82,6 +82,7 @@ cc_library(
96+
"//absl/base:nullability",
97+
"//absl/debugging:leak_check",
98+
"//absl/strings",
99+
+ "//absl/strings:has_ostream_operator",
100+
],
101+
)
102+
103+
diff --git a/absl/log/internal/check_op.h b/absl/log/internal/check_op.h
104+
index 4554475..c607864 100644
105+
--- a/absl/log/internal/check_op.h
106+
+++ b/absl/log/internal/check_op.h
107+
@@ -40,6 +40,7 @@
108+
#include "absl/log/internal/nullstream.h"
109+
#include "absl/log/internal/strip.h"
110+
#include "absl/strings/has_absl_stringify.h"
111+
+#include "absl/strings/has_ostream_operator.h"
112+
#include "absl/strings/string_view.h"
113+
114+
// `ABSL_LOG_INTERNAL_STRIP_STRING_LITERAL` wraps string literals that
115+
@@ -357,21 +358,12 @@ std::enable_if_t<HasAbslStringify<T>::value,
116+
StringifyToStreamWrapper<T>>
117+
Detect(...); // Ellipsis has lowest preference when int passed.
118+
119+
-// is_streamable is true for types that have an output stream operator<<.
120+
-template <class T, class = void>
121+
-struct is_streamable : std::false_type {};
122+
-
123+
-template <class T>
124+
-struct is_streamable<T, std::void_t<decltype(std::declval<std::ostream&>()
125+
- << std::declval<T>())>>
126+
- : std::true_type {};
127+
-
128+
// This overload triggers when T is neither possible to print nor an enum.
129+
template <typename T>
130+
std::enable_if_t<std::negation_v<std::disjunction<
131+
std::is_convertible<T, int>, std::is_enum<T>,
132+
std::is_pointer<T>, std::is_same<T, std::nullptr_t>,
133+
- is_streamable<T>, HasAbslStringify<T>>>,
134+
+ HasOstreamOperator<T>, HasAbslStringify<T>>>,
135+
UnprintableWrapper>
136+
Detect(...);
137+
138+
@@ -382,9 +374,10 @@ Detect(...);
139+
// one backed by another integer is converted to (u)int64_t.
140+
template <typename T>
141+
std::enable_if_t<
142+
- std::conjunction_v<
143+
- std::is_enum<T>, std::negation<std::is_convertible<T, int>>,
144+
- std::negation<is_streamable<T>>, std::negation<HasAbslStringify<T>>>,
145+
+ std::conjunction_v<std::is_enum<T>,
146+
+ std::negation<std::is_convertible<T, int>>,
147+
+ std::negation<HasOstreamOperator<T>>,
148+
+ std::negation<HasAbslStringify<T>>>,
149+
std::conditional_t<
150+
std::is_same_v<std::underlying_type_t<T>, bool> ||
151+
std::is_same_v<std::underlying_type_t<T>, char> ||

patches/re2-2024-07-02.patch

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index bdac5af..cedaf6e 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -131,6 +131,13 @@ set(RE2_HEADERS
6+
7+
add_library(re2 ${RE2_SOURCES})
8+
target_compile_features(re2 PUBLIC cxx_std_14)
9+
+if(APPLE)
10+
+ set_target_properties(re2 PROPERTIES
11+
+ INSTALL_RPATH "@loader_path")
12+
+elseif(UNIX)
13+
+ set_target_properties(re2 PROPERTIES
14+
+ INSTALL_RPATH "$ORIGIN")
15+
+endif()
16+
target_include_directories(re2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
17+
# CMake gives "set_target_properties called with incorrect number of arguments."
18+
# errors if we don't quote ${RE2_HEADERS}, so quote it despite prevailing style.

0 commit comments

Comments
 (0)