www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - "version" predefined pragma

reply Dave <Dave_member pathlink.com> writes:
Along the same lines as pragma(lib,...) I'm wondering if it would make sense to
add something like pragma(switch,...) also, e.g.:

pragma(switch,"-version=MY_VERSION");
version(Windows)
{
pragma(switch,"-L/SUBSYSTEM:windows:5");
}

That would act like the command-line:

C:\>dmd foo.d bar.d version=MY_VERSION -L/SUBSYSTEM:windows:5
Feb 21 2006
next sibling parent Derek Parnell <derek psych.ward> writes:
On Wed, 22 Feb 2006 03:52:38 +0000 (UTC), Dave wrote:

 Along the same lines as pragma(lib,...) I'm wondering if it would make sense to
 add something like pragma(switch,...) also, e.g.:
 
 pragma(switch,"-version=MY_VERSION");
 version(Windows)
 {
 pragma(switch,"-L/SUBSYSTEM:windows:5");
 }
 
 That would act like the command-line:
 
 C:\>dmd foo.d bar.d version=MY_VERSION -L/SUBSYSTEM:windows:5

You can do this sort of thing with Build. version(build) { pragma(export_version, MY_VERSION); version(Windows) { pragma (build_def, "EXETYPE NT"); pragma (build_def, "SUBSYSTEM WINDOWS,4.0") } } Though the Windows subsystem is normally handled automatically but the pragma allows you to override the standard values. -- Derek (skype: derek.j.parnell) Melbourne, Australia "Down with mediocracy!" 22/02/2006 3:10:50 PM
Feb 21 2006
prev sibling parent reply Victor Nakoryakov <nail-mail mail.ru> writes:
Dave wrote:
 Along the same lines as pragma(lib,...) I'm wondering if it would make sense to
 add something like pragma(switch,...) also, e.g.:
 
 pragma(switch,"-version=MY_VERSION");
 version(Windows)
 {
 pragma(switch,"-L/SUBSYSTEM:windows:5");
 }
 
 That would act like the command-line:
 
 C:\>dmd foo.d bar.d version=MY_VERSION -L/SUBSYSTEM:windows:5
 
 

Because there is to only dmd compiler, and there are different switches for different compilers. -- Victor (aka nail) Nakoryakov nail-mail [at] mail.ru Krasnoznamensk, Moscow, Russia
Feb 23 2006
parent Alexander Panek <alexander.panek brainsware.org> writes:
Victor Nakoryakov wrote:
 Dave wrote:
 
 Along the same lines as pragma(lib,...) I'm wondering if it would make 
 sense to
 add something like pragma(switch,...) also, e.g.:

 pragma(switch,"-version=MY_VERSION");
 version(Windows)
 {
 pragma(switch,"-L/SUBSYSTEM:windows:5");
 }

 That would act like the command-line:

 C:\>dmd foo.d bar.d version=MY_VERSION -L/SUBSYSTEM:windows:5

Because there is to only dmd compiler, and there are different switches for different compilers.

version(DigitalMars) { pragma(switch,..); version(...) { pragma(..); } } Good enough, I guess.
Feb 23 2006