Re: Wanted: macro to hide code in a release build?
- Date: Sun, 18 May 2008 23:10:47 +0200
- From: "Friedrich W. H. Kossebau" <kossebau@xxxxxxx>
- Subject: Re: Wanted: macro to hide code in a release build?
Am Sonntag, 18. Mai 2008, um 21:58 Uhr, schrieb Friedrich W. H. Kossebau:
> Am Sonntag, 18. Mai 2008, um 21:34 Uhr, schrieb Chusslove Illich:
> > > [: Friedrich W. H. Kossebau :]
> > > But what macro can I use in the code?
> > >
> > > #ifdef ???
> > > mControllers.append( new VersionViewController(this) );
> > > #endif
> >
> > #ifndef NDEBUG ought to do it. NDEBUG is defined when
> > -DCMAKE_BUILD_TYPE=release is passed to cmake.
>
> So "#ifndef NDEBUG" is it for code.
> And "if( CMAKE_BUILD_TYPE_TOLOWER MATCHES release)" as eqivalent for
> CMakeLists.txt.
For the record:
The real equivalent is the one with a NOT before:
"if( NOT CMAKE_BUILD_TYPE_TOLOWER MATCHES release)"
Or just exchange the conditioned branches, as I did.
Friedrich
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<