[Mesa-dev] [PATCH 2/2] configure.ac: add --enable-assertions

Marek Olšák maraeo at gmail.com
Tue Apr 14 05:27:23 PDT 2015


If --enable-debug is used, --enable-assertions is ignored.
--enable-assertions is basically a weaker version of --enable-debug.

There are 2 assert definitions in Mesa:
- The one that is enabled if DEBUG is defined (gallium only).
- The one that is enabled if NDEBUG is not defined (the standard version).

Both conditions must be met for assertions to be enabled everywhere.

If somebody wants to remove the gallium assert in favor of the
standard one, then be it, but that's beyond the scope of this patch.

Marek

On Tue, Apr 14, 2015 at 2:13 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Hi Marek
>
> On 13 April 2015 at 21:06, Marek Olšák <maraeo at gmail.com> wrote:
>> From: Marek Olšák <marek.olsak at amd.com>
>>
>> ---
>>  configure.ac | 11 ++++++++++-
>>  1 file changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 6ccf3b4..f5eeb7d 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -402,6 +402,13 @@ AC_ARG_ENABLE([debug],
>>      [enable_debug="$enableval"],
>>      [enable_debug=no]
>>  )
>> +AC_ARG_ENABLE([assertions],
>> +    [AS_HELP_STRING([--enable-assertions],
>> +        [add debug definitions to enable assertions and other debug checks @<:@default=disabled@:>@])],
> Can we keep this only for asserts (NDEBUG) as the name suggests ?
> Otherwise things might get bit too messy when combining with
> --enable-debug. Especially since most places of mesa reply on DEBUG,
> while the asserts definition depends on NDEBUG.
>
> Thanks
> Emil


More information about the mesa-dev mailing list