Predefined 'release' version?

Ali Çehreli acehreli at yahoo.com
Fri Apr 20 10:43:48 PDT 2012


On 04/20/2012 10:24 AM, Bernard Helyer wrote:
> On Friday, 20 April 2012 at 15:26:24 UTC, H. S. Teoh wrote:
>> I just discovered to my dismay that dmd does not define version=release
>> when compiling in -release mode. What's the reason for this?
>>
>> I have some code that uses ctRegex, which slows down compilation
>> significantly due to heavy amounts of CTFE, but which speeds up the
>> final executable. I'd like to version this code and use regular regex()
>> for non-release builds, and switch to ctRegex for release builds. Yes I
>> can just pass in a version on the commandline, but it'd be nice if it
>> could be triggered automatically by -release.
>>
>>
>> T
>
> debug {
> // blah
> } else {
> // fast blah
> }
>

debug blocks are activated when -debug switch is explicitly specified, 
not when -release is not specified. :)

Ali


More information about the Digitalmars-d mailing list