[neon/extras/qcoro/Neon/release] debian: use -Werror only in debug builds (#1016282)
Pino Toscano
null at kde.org
Thu Sep 8 17:12:01 BST 2022
Git commit 11eb4899e4f7bba282c5a8f23a63c5777bc3bd61 by Pino Toscano.
Committed on 07/08/2022 at 05:07.
Pushed by jriddell into branch 'Neon/release'.
use -Werror only in debug builds (#1016282)
backport upstream commit eba5ec31ba7a270df91986f9af94f688151da9e6
M +5 -0 debian/changelog
A +1 -0 debian/patches/series
A +54 -0 debian/patches/upstream_Only-enable-Werror-and-related-flags-in-debug-mode-f.patch
https://invent.kde.org/neon/extras/qcoro/commit/11eb4899e4f7bba282c5a8f23a63c5777bc3bd61
diff --git a/debian/changelog b/debian/changelog
index dd5f27e..f16ffc1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,10 @@
qcoro (0.6.0-4) UNRELEASED; urgency=medium
+ [ Pino Toscano ]
+ * Backport upstream commit eba5ec31ba7a270df91986f9af94f688151da9e6 to use
+ -Werror only in debug builds; patch
+ upstream_Only-enable-Werror-and-related-flags-in-debug-mode-f.patch.
+ (Closes: #1016282)
-- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org> Sun, 07 Aug 2022 07:05:19 +0200
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..5d00e8e
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+upstream_Only-enable-Werror-and-related-flags-in-debug-mode-f.patch
diff --git a/debian/patches/upstream_Only-enable-Werror-and-related-flags-in-debug-mode-f.patch b/debian/patches/upstream_Only-enable-Werror-and-related-flags-in-debug-mode-f.patch
new file mode 100644
index 0000000..7c310ad
--- /dev/null
+++ b/debian/patches/upstream_Only-enable-Werror-and-related-flags-in-debug-mode-f.patch
@@ -0,0 +1,54 @@
+From eba5ec31ba7a270df91986f9af94f688151da9e6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil at kde.org>
+Date: Sun, 10 Jul 2022 22:23:07 +0200
+Subject: [PATCH] Only enable -Werror (and related flags) in debug mode (fixes
+ #94)
+
+---
+ .github/workflows/build.yml | 2 +-
+ CMakeLists.txt | 7 ++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
+index 6e4a1c9..7174e70 100644
+--- a/.github/workflows/build.yml
++++ b/.github/workflows/build.yml
+@@ -9,7 +9,7 @@ on:
+
+
+ env:
+- BUILD_TYPE: RelWithDebInfo
++ BUILD_TYPE: Debug
+ QTEST_FUNCTION_TIMEOUT: 60000
+
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4a8d2a2..b4d46a3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -88,10 +88,10 @@ set(CMAKE_CXX_STANDARD 20)
+ set(CMAKE_AUTOMOC ON)
+
+ if (MSVC)
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /WX")
++ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W4 /WX")
+ # Disable warning C5054: "operator '&': deprecated between enumerations of different types" caused by QtWidgets/qsizepolicy.h
+ # Disable warning C4127: "conditional expression is constant" caused by QtCore/qiterable.h
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd5054 /wd4127")
++ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /wd5054 /wd4127")
+
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ # Explicitly enable exceptions support for clang-cl (it's only enabled by CMake when targeting the Windows-MSVC platform,
+@@ -99,7 +99,8 @@ if (MSVC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
+ endif()
+ else()
+- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic")
++ # Only enable strict warnings in debug mode
++ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Werror -pedantic")
+ endif()
+
+ if (QCORO_ENABLE_ASAN)
+--
+2.35.1
+
More information about the Neon-commits
mailing list