From a958b586b219fb01fbe6c2055b97c2cb2216a55f Mon Sep 17 00:00:00 2001 From: Ivy233 Date: Tue, 8 Sep 2026 13:52:51 +0800 Subject: [PATCH] build: align local compile flags with dpkg-buildpackage Enable the same warning flags as dpkg-buildpackage for C and C++ targets so that a plain `cmake -Bbuild && cmake --build build` reports the same warnings/errors as the package build. debian/rules already appends -Wall (DEB_CXXFLAGS_MAINT_APPEND) and hardening=+all adds -Wformat -Werror=format-security; mirror those locally alongside the existing -Werror so warnings that would only fail the dpkg build are caught during local development. Log: align local cmake compile flags with dpkg-buildpackage PMS: TASK-394335 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f43150880..f705c21e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,9 @@ endif () set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wformat>) +add_compile_options($<$:-Werror=format-security>) add_compile_options($<$:-Werror>) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOMOC ON)