From 225b3fcdf74284f6aaff2185728698512c36914b Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Sun, 1 May 2022 11:27:13 +0800 Subject: [PATCH] fix: clang 13.1 compile (#12082) * [TD-14218]: clang compile * [TD-14218]: clang compile check clang version * [TD-14218]: clang compile check clang version greater or equal * fix clang 13 compile error otherwise compile will fails with unused variable warning adjust to 13.0 * fix: use compile option for clang 13.1 or greater [TD-14218] * fix: clang 13.1 compile error --- cmake/define.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/define.inc b/cmake/define.inc index 9e3d4a0dfa..0bbc36878d 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -291,7 +291,7 @@ MESSAGE(STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID}) IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") EXECUTE_PROCESS( COMMAND ${CMAKE_CXX_COMPILER} --version OUTPUT_VARIABLE clang_full_version_string ) string (REGEX REPLACE ".*clang version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string}) - IF (CLANG_VERSION_STRING GREATER_EQUAL 13.0) + IF (CLANG_VERSION_STRING GREATER_EQUAL 13.1) SET(COMMON_FLAGS "${COMMON_FLAGS} -Wno-unused-but-set-variable") ENDIF () ENDIF () -- GitLab