www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What is the equivalent of -version=Flag for conditional compilation in

reply data pulverizer <data.pulverizer gmail.com> writes:
Hi,

I was switching from dmd to ldc2 and would like to know the 
equivalent command line for conditional compilation -version=Flag 
I was using in dmd. I checked the ldc2 --help but didn't see 
anything relevant. Version there refers to compiler version or 
some other unrelated things.

Thanks
Jun 05 2020
next sibling parent reply Steven Schveighoffer <schveiguy gmail.com> writes:
On 6/5/20 6:36 PM, data pulverizer wrote:
 Hi,
 
 I was switching from dmd to ldc2 and would like to know the equivalent 
 command line for conditional compilation -version=Flag I was using in 
 dmd. I checked the ldc2 --help but didn't see anything relevant. Version 
 there refers to compiler version or some other unrelated things.
It's in there, I had to do grep to find it: --d-version=<level/idents> - Compile in version code >= <level> or identified by <idents> -Steve
Jun 05 2020
parent data pulverizer <data.pulverizer gmail.com> writes:
On Friday, 5 June 2020 at 22:39:23 UTC, Steven Schveighoffer 
wrote:
 It's in there, I had to do grep to find it:

   --d-version=<level/idents>             - Compile in version 
 code >= <level> or identified by <idents>

 -Steve
Thanks, I tried that but didn't realise I still had the old version flag in the command line and assumed it didn't work! Lol - silly!
Jun 05 2020
prev sibling parent Johan <j j.nl> writes:
On Friday, 5 June 2020 at 22:36:23 UTC, data pulverizer wrote:
 Hi,

 I was switching from dmd to ldc2 and would like to know the 
 equivalent command line for conditional compilation 
 -version=Flag I was using in dmd. I checked the ldc2 --help but 
 didn't see anything relevant. Version there refers to compiler 
 version or some other unrelated things.
You can also use `ldmd2` as driver for ldc2 with dmd commandline syntax. -Johan
Jun 05 2020