diff options
author | Ryan Hill <rhill@gentoo.org> | 2015-10-22 23:19:44 -0600 |
---|---|---|
committer | Ryan Hill <rhill@gentoo.org> | 2015-10-23 23:14:21 -0600 |
commit | 277aa8e05065e73499e8e24cfa9f24221348b4b3 (patch) | |
tree | 16f1513c764567247a5420705d1855856b3bc913 /eclass | |
parent | 84c5c9db7a7630fb28cb7daa92290e65615e9e00 (diff) | |
download | gentoo-277aa8e05065e73499e8e24cfa9f24221348b4b3.tar.gz gentoo-277aa8e05065e73499e8e24cfa9f24221348b4b3.tar.xz |
wxwidgets.eclass: Define -DNDEBUG when building against wxGTK:3.0
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
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/wxwidgets.eclass | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass index 07e2d8c8e19..ea7cf9f4c75 100644 --- a/eclass/wxwidgets.eclass +++ b/eclass/wxwidgets.eclass @@ -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. @@ -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 @@ -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}" |