diff --git a/CMakeLists.txt b/CMakeLists.txt index 66f3fe5f0..608eae0cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,9 @@ if(CMAKE_COMPILER_IS_CLANG) set(CMAKE_C_FLAGS_MEMSAN "-fsanitize=memory -O3") set(CMAKE_C_FLAGS_MEMSANDBG "-fsanitize=memory -O1 -g3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize-memory-track-origins=2") set(CMAKE_C_FLAGS_CHECK "-Os") + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable") + endif() endif(CMAKE_COMPILER_IS_CLANG) if(CMAKE_COMPILER_IS_IAR) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 07599f5d1..e937bc366 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -170,7 +170,10 @@ if(CMAKE_COMPILER_IS_GNUCC) endif(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_CLANG) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wno-documentation-deprecated-sync -Wunreachable-code") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdocumentation") + endif() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wno-documentation-deprecated-sync -Wunreachable-code") endif(CMAKE_COMPILER_IS_CLANG) if(WIN32)