未验证 提交 225b3fcd 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

fix: clang 13.1 compile (#12082)

* [TD-14218]<fix>: clang compile

* [TD-14218]<fix>: clang compile

check clang version

* [TD-14218]<fix>: 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
上级 b33936af
......@@ -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 ()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册