[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: CMake and NDEBUG



On Wed, Apr 25, 2018 at 01:36:19PM +0200, Sébastien Jodogne wrote:
> The Debian packages for Orthanc and its associated plugins pay attention to
> the fact of *not* setting "-DCMAKE_BUILD_TYPE=Release", as requested by the
> Debian policy [2].
You are not linking the Policy though. The Policy doesn't mention CMake.
The policy only says "any binaries created should include debugging
information, as well as being compiled with optimization". One could say
this means "-DCMAKE_BUILD_TYPE=RelWithDebInfo", but of course it depends
on what flags does the upstream set with different CMAKE_BUILD_TYPE or
unconditionally.

> I have not been able to find a definite answer about how "NDEBUG" should be
> properly handled.
Well, the bug report you've linked says "-DNDEBUG is required not to be
set" and provides links about that. The ultimate reason for that, though,
is just https://lists.debian.org/debian-devel/2013/02/msg00304.html 
Your case is even mentioned down the thread:
https://lists.debian.org/debian-devel/2013/02/msg00353.html

>I am considering to add the following arguments wile
> invoking CMake in debian/rules in order to have "NDEBUG" manually defined:
> 
> cmake -DCMAKE_C_FLAGS=-DNDEBUG -DCMAKE_CXX_FLAGS=-DNDEBUG [...]
> 
> Please someone could validate this approach wrt. Debian policy? TIA!
The Policy doesn't say anything about this, except for the part quoted
above.

I also want to mention that while I don't like a lot of things stated in
#711515 and in the links found in it, the strangest thing for me is
"Strictly speaking build system (eg. cmake) should not try to set any
compilation flags themselves. It is required by policy that CFLAGS and
CXXFLAGS (solely) are used when building." from #701233.

-- 
WBR, wRAR

Attachment: signature.asc
Description: PGP signature


Reply to: