Skip to content

Commit

Permalink
Only add -Wno-unused-but-set-variable flag when using clang >= 13.0.0
Browse files Browse the repository at this point in the history
The flag is only available for clang versions >= 13.0.0 according to the
manual for versions 12.0.1 and 13.0.0
- https://releases.llvm.org/12.0.1/tools/clang/docs/DiagnosticsReference.html
- https://releases.llvm.org/13.0.0/tools/clang/docs/DiagnosticsReference.html
  • Loading branch information
DrTobe committed May 8, 2023
1 parent d6b4886 commit 4f835df
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mbedtls-sys/vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,10 @@ if(CMAKE_COMPILER_IS_GNU)
endif(CMAKE_COMPILER_IS_GNU)

if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-but-set-variable -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings -Wpointer-arith -Wimplicit-fallthrough -Wshadow -Wvla -Wformat=2 -Wno-format-nonliteral")
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 13.0.0)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-but-set-variable")
endif()
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_C_FLAGS_COVERAGE "-O0 -g3 --coverage")
Expand Down

0 comments on commit 4f835df

Please sign in to comment.