Skip to content

Commit bf97e11

Browse files
committed
[C] Workaround GoogleTest compilation issue on Clang 21.
1 parent 0385244 commit bf97e11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ find_package(Threads)
100100
if (UNIX)
101101
add_compile_options(-Wall -Wpedantic -Wextra -Wno-unused-parameter)
102102

103+
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "21.0")
104+
# See gtest: https://github.com/google/googletest/issues/4762
105+
add_compile_options(-Wno-error=character-conversion)
106+
endif ()
107+
103108
if (C_WARNINGS_AS_ERRORS)
104109
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Werror>)
105110
endif (C_WARNINGS_AS_ERRORS)

0 commit comments

Comments
 (0)