Skip to content

Commit

Permalink
wxwidgets.eclass: Define -DNDEBUG when building against wxGTK:3.0
Browse files Browse the repository at this point in the history
In wxGTK 3.0 debugging support is always enabled in the library and
it's up to packages to state if they want to use it or not.  When
enabled this makes warning dialogs pop up any time an assertion
is encountered, which isn't very user friendly.  This disables that
behavior by adding -DNDEBUG to CPPFLAGS unless the package has a
debug USE flag and it is enabled.

Gentoo-Bug: https://bugs.gentoo.org/562480
  • Loading branch information
dirtyepic committed Oct 24, 2015
1 parent 84c5c9d commit 277aa8e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions eclass/wxwidgets.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@
#
# Note: unless you know your package works with wxbase (which is very
# doubtful), always depend on wxGTK[X].
#
# Debugging: In wxGTK 3.0 and later debugging support is enabled in the
# library by default and needs to be controlled at the package level.
# Use the -DNDEBUG preprocessor flag to disable debugging features.
# (Using need-wxwidgets will do this for you, see below.)

inherit eutils multilib
inherit eutils flag-o-matic multilib

# We do this in global scope so ebuilds can get sane defaults just by
# inheriting.
Expand All @@ -80,10 +85,18 @@ fi
# @USAGE: <profile>
# @DESCRIPTION:
#
# Available configurations are:
# Available profiles are:
#
# unicode (USE="X")
# base-unicode (USE="-X")
#
# This lets you choose which config file from /usr/lib/wx/config is used when
# building the package. It also exports ${WX_CONFIG} with the full path to
# that config.
#
# If your ebuild does not have a debug USE flag, or it has one and it is
# disabled, -DNDEBUG will be automatically added to CPPFLAGS. This can be
# overridden by setting WX_DISABLE_DEBUG if you want to handle it yourself.

need-wxwidgets() {
local wxtoolkit wxdebug wxconf
Expand Down Expand Up @@ -124,6 +137,10 @@ need-wxwidgets() {
else
wxdebug="release-"
fi
else
if [[ -z ${WX_DISABLE_DEBUG} ]]; then
use_if_iuse debug || append-cppflags -DNDEBUG
fi
fi

wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}"
Expand Down

0 comments on commit 277aa8e

Please sign in to comment.