Skip to content

Commit b92772d

Browse files
Fix Abseil ABI mismatch on linking with AppleClang
1 parent e62cf80 commit b92772d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cpp/cmake_modules/ThirdpartyToolchain.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,6 +2183,10 @@ function(build_protobuf)
21832183
set(PROTOBUF_HOST_CMAKE_ARGS
21842184
"-DCMAKE_CXX_FLAGS="
21852185
"-DCMAKE_C_FLAGS="
2186+
# Explicitly set the C++ standard for the host build. Without this,
2187+
# Abseil may be compiled with the host compiler's default standard,
2188+
# which can be older than C++17.
2189+
"-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
21862190
"-DCMAKE_INSTALL_PREFIX=${PROTOBUF_HOST_PREFIX}"
21872191
-Dprotobuf_BUILD_TESTS=OFF
21882192
-Dprotobuf_DEBUG_POSTFIX=

0 commit comments

Comments
 (0)