only 13.1 support unused-but-set-variable

This commit is contained in:
Shuduo Sang 2022-04-24 07:41:46 +08:00
parent 7c0f362021
commit 23978db17a
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
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(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
else()
if(NOT CMAKE_CXX_FLAGS MATCHES "-Werror")