From fcf1419626c9f37d7583581199088a7248c52e37 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Thu, 3 Jun 2021 12:58:44 +0200 Subject: [PATCH] Build: Fix CMake to pass -Wwrite-string compiler flag if enabled --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91c1399341..0d03e87290 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,6 +74,10 @@ if(CONFIG_COMPILER_DISABLE_GCC8_WARNINGS) "-Wno-int-in-bool-context") endif() +if(CONFIG_COMPILER_WARN_WRITE_STRINGS) + list(APPEND compile_options "-Wwrite-strings") +endif() + if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE) list(APPEND compile_definitions "-DNDEBUG") endif()