[MacPorts] #62642: cmake 1.1 portgroup sets -DDEBUG for the +debug variant

MacPorts noreply at macports.org
Tue Apr 6 13:37:09 UTC 2021


#62642: cmake 1.1 portgroup sets -DDEBUG for the +debug variant
----------------------+--------------------
 Reporter:  szhorvat  |      Owner:  (none)
     Type:  defect    |     Status:  new
 Priority:  Normal    |  Milestone:
Component:  ports     |    Version:  2.6.4
 Keywords:            |       Port:
----------------------+--------------------
 The cmake 1.1 portgroup automatically creates the `+debug` variant, and
 will use the compiler option `-DDEBUG`.  As far as I can tell, this is a
 completely arbitrary choice. Unlike `NDEBUG`, `DEBUG` is not a standard
 macro name, and should not be used for all ports.

 In fact, this breaks the `+debug` variant of the igraph port. This was
 completely unexpected to the igraph project: we simply did not anticipate
 that anyone would try to compile the library with `-DDEBUG`. There is some
 borrowed code within igraph which had some broken `printf`s fenced by
 `#ifdef DEBUG`s, which caused the failure. I will fix this within igraph,
 but regardless of that, MacPorts's behaviour seems unjustified here.

 I suggest simply not using `-DDEBUG` by default. If a port needs it for
 its debug mode, it should include it explicitly, not the reverse (i.e.
 having to remove it explicitly).

 This behaviour was originally added here: https://github.com/macports
 /macports-ports/commit/e8f9c3dbe31f1b604b076a8753b3ea26d265e276

-- 
Ticket URL: <https://trac.macports.org/ticket/62642>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list