add build option to always enable asserts (i.e. allow asserts in release builds)

This commit is contained in:
Arvid Norberg 2011-05-07 19:58:38 +00:00
parent 923fb1eac5
commit a329a11b57
4 changed files with 7 additions and 4 deletions

View File

@ -247,7 +247,8 @@ feature.compose <iconv>off : <define>TORRENT_USE_ICONV=0 ;
feature full-stats : on off : composite propagated link-incompatible ; feature full-stats : on off : composite propagated link-incompatible ;
feature.compose <full-stats>off : <define>TORRENT_DISABLE_FULL_STATS ; feature.compose <full-stats>off : <define>TORRENT_DISABLE_FULL_STATS ;
feature asserts : on off production system : composite propagated ; feature asserts : auto on off production system : composite propagated ;
feature.compose <asserts>on : <define>TORRENT_RELEASE_ASSERTS=1 ;
feature.compose <asserts>production : <define>TORRENT_PRODUCTION_ASSERTS=1 ; feature.compose <asserts>production : <define>TORRENT_PRODUCTION_ASSERTS=1 ;
feature.compose <asserts>off : <define>TORRENT_NO_ASSERTS=1 ; feature.compose <asserts>off : <define>TORRENT_NO_ASSERTS=1 ;
feature.compose <asserts>system : <define>TORRENT_USE_SYSTEM_ASSERTS=1 ; feature.compose <asserts>system : <define>TORRENT_USE_SYSTEM_ASSERTS=1 ;

View File

@ -266,7 +266,8 @@ Build features:
| | requires you to link against librt.a. This is | | | requires you to link against librt.a. This is |
| | typically the case on x86 64 bit systems. | | | typically the case on x86 64 bit systems. |
+--------------------------+----------------------------------------------------+ +--------------------------+----------------------------------------------------+
| ``asserts`` | * ``on`` - asserts are on if in debug mode | | ``asserts`` | * ``auto`` - asserts are on if in debug mode |
| | * ``on`` - asserts are on, even in release mode |
| | * ``off`` - asserts are disabled | | | * ``off`` - asserts are disabled |
| | * ``production`` - assertion failures are logged | | | * ``production`` - assertion failures are logged |
| | to ``asserts.log`` in the current working | | | to ``asserts.log`` in the current working |

View File

@ -34,7 +34,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/config.hpp" #include "libtorrent/config.hpp"
#if (!defined TORRENT_DEBUG && !TORRENT_PRODUCTION_ASSERTS) || TORRENT_NO_ASSERTS #if (!defined TORRENT_DEBUG && !TORRENT_PRODUCTION_ASSERTS && TORRENT_RELEASE_ASSERTS) \
|| TORRENT_NO_ASSERTS
#define TORRENT_ASSERT(a) do {} while(false) #define TORRENT_ASSERT(a) do {} while(false)
#define TORRENT_ASSERT_VAL(a, b) do {} while(false) #define TORRENT_ASSERT_VAL(a, b) do {} while(false)
#else #else

View File

@ -30,7 +30,7 @@ POSSIBILITY OF SUCH DAMAGE.
*/ */
#if defined TORRENT_DEBUG || defined TORRENT_ASIO_DEBUGGING #if defined TORRENT_DEBUG || defined TORRENT_ASIO_DEBUGGING || TORRENT_RELEASE_ASSERTS
#ifdef __APPLE__ #ifdef __APPLE__
#include <AvailabilityMacros.h> #include <AvailabilityMacros.h>