File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ option(SILKWORM_CLANG_TIDY "Clang-Tidy linter" OFF)
55
55
option (SILKWORM_SANITIZE "Build instrumentation for sanitizers" OFF )
56
56
option (SILKWORM_FUZZER "Build instrumentation for fuzzers" OFF )
57
57
option (SILKWORM_USE_MIMALLOC "Enable using mimalloc for dynamic memory management" ON )
58
+ option (SILKWORM_ALLOW_UNUSED_VAR_WARNINGS "Turn unused variable errors into warnings" OFF )
58
59
59
60
if (NOT SILKWORM_HAS_PARENT )
60
61
include (cmake/conan.cmake )
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ elseif((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MAT
33
33
add_compile_options (-Wtype-limits -Wformat=2 )
34
34
add_compile_options (-Wno-missing-field-initializers )
35
35
36
+ if (SILKWORM_ALLOW_UNUSED_VAR_WARNINGS )
37
+ add_compile_options (-Wno-error=unused-parameter )
38
+ add_compile_options (-Wno-error=unused-variable )
39
+ endif ()
40
+
36
41
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
37
42
add_compile_options (-Wduplicated-cond -Wduplicated-branches -Wlogical-op )
38
43
add_compile_options (-Wno-attributes )
You can’t perform that action at this time.
0 commit comments