debian/patches: add 0003-CMakeLists.txt-define-DEBUG-1-only-when-CMAKE_BUILD_.patch
authorAntonio Ospite <ospite@studenti.unina.it>
Wed, 30 Oct 2013 09:49:56 +0000 (10:49 +0100)
committerAntonio Ospite <ospite@studenti.unina.it>
Wed, 30 Oct 2013 09:49:56 +0000 (10:49 +0100)
DEBUG=1 should not be enabled for Debian packages which are built with
CMAKE_BUILD_TYPE=RelWithDebInfo.

debian/patches/0003-CMakeLists.txt-define-DEBUG-1-only-when-CMAKE_BUILD_.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0003-CMakeLists.txt-define-DEBUG-1-only-when-CMAKE_BUILD_.patch b/debian/patches/0003-CMakeLists.txt-define-DEBUG-1-only-when-CMAKE_BUILD_.patch
new file mode 100644 (file)
index 0000000..9ba2b6c
--- /dev/null
@@ -0,0 +1,46 @@
+From f3b176f27268e13942f452e915171b9c8b34f6ce Mon Sep 17 00:00:00 2001
+From: Antonio Ospite <ospite@studenti.unina.it>
+Date: Wed, 30 Oct 2013 10:41:06 +0100
+Subject: [PATCH] CMakeLists.txt: define DEBUG=1 only when
+ CMAKE_BUILD_TYPE=Debug
+X-Face: z*RaLf`X<@C75u6Ig9}{oW$H;1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb;]yA5<GWI5`6u&+
+ ;6b'@y|8w"wB;4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG
+ !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE
+
+When building with CMAKE_BUILD_TYPE=RelWithDebInfo the development debug
+code should not be enabled, so don't define DEBUG=1 in DEBUG_FLAGS as
+this will end up being both in CMAKE_C_FLAGS_DEBUG and
+CMAKE_C_FLAGS_RELWITHDEBINFO.
+
+Instead define DEBUG=1 only for CMAKE_C_FLAGS_DEBUG so it gets used only
+when CMAKE_BUILD_TYPE=Debug.
+---
+ CMakeLists.txt | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d643ed9..fa111c9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -69,8 +69,7 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+     -fstack-protector)
+   add_flags(DEBUG_FLAGS
+-    -ggdb
+-    -DDEBUG=1)
++    -ggdb)
+   add_flags(RELEASE_FLAGS
+     -Wp,-D_FORTIFY_SOURCE=2)
+@@ -105,7 +104,7 @@ if (CMAKE_COMPILER_IS_CLANG)
+   endif()
+ endif()
+-set(CMAKE_C_FLAGS_DEBUG "-O0 ${DEBUG_FLAGS} ${STRICT_FLAGS}")
++set(CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG=1 ${DEBUG_FLAGS} ${STRICT_FLAGS}")
+ set(CMAKE_C_FLAGS_RELEASE "-O2 ${RELEASE_FLAGS} ${STRICT_FLAGS}")
+ set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 ${RELEASE_FLAGS} ${DEBUG_FLAGS} ${STRICT_FLAGS}")
+-- 
+1.8.4.rc3
+
index 66eefd8..b35cc3c 100644 (file)
@@ -1,2 +1,3 @@
 0001-Revert-am7xxx-play-switch-to-avcodec_encode_video2.patch
 0002-am7xxx-add-quirks-for-Philips-Sagemcom-PicoPix-2055.patch
+0003-CMakeLists.txt-define-DEBUG-1-only-when-CMAKE_BUILD_.patch