From cc1f708d756c6739fdd59722963d324b865014cd Mon Sep 17 00:00:00 2001 From: Joey Parrish Date: Thu, 3 Nov 2022 11:18:33 -0700 Subject: [PATCH] Fix misdetection of libatomic with strict compiler flags With strict flags and -Werror, the detection for libatomic breaks, causing it to be included in places where it is not needed. And on macOS, this leads to a link error when libatomic cannot be found. Closes #10899 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cab1ff68e0..f60142b207 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -238,7 +238,7 @@ if (NOT MSVC) check_cxx_source_compiles(" #include int main() { - return std::atomic{}; + return static_cast(std::atomic{}); } " protobuf_HAVE_BUILTIN_ATOMICS) if (NOT protobuf_HAVE_BUILTIN_ATOMICS)