diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,6 +23,7 @@ option(ENABLE_QRCODE "Enable QR code display" ON) option(ENABLE_UPNP "Enable UPnP support" ON) option(ENABLE_NOTIFICATIONS "Enable desktop notifications" ON) +option(ENABLE_WERROR "Promote some compiler warnings to errors" OFF) option(START_WITH_UPNP "Make UPnP the default to map ports" OFF) # Allow usage of sanitizers by setting ECM_ENABLE_SANITIZERS @@ -158,6 +159,13 @@ add_compiler_flags(-Wno-implicit-fallthrough) endif() +if(ENABLE_WERROR) + add_compiler_flags( + -Werror=vla + -Werror=thread-safety-analysis + ) +endif() + # Create a target for OpenSSL include(BrewHelper) find_brew_prefix(OPENSSL_ROOT_DIR openssl)