diff --git a/cmake/define.inc b/cmake/define.inc index a15a0725ebcc04683cee3559e69cf667a060fc7d..93f1d6fcbc40f351ee8165a73155257baf2f1155 100755 --- a/cmake/define.inc +++ b/cmake/define.inc @@ -287,9 +287,17 @@ IF (TD_LINUX) SET(COMMON_FLAGS "${COMMON_FLAGS} -pipe -Wshadow") ENDIF () +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 VERSION_GREATER 13.1) + SET(COMMON_FLAGS "${COMMON_FLAGS} -Wno-unused-but-set-variable") + ENDIF () +ENDIF () + INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/os/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/util/inc) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/common/inc) -MESSAGE(STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID})