digitalmars.D - "version" predefined pragma
- Dave <Dave_member pathlink.com> Feb 21 2006
- Derek Parnell <derek psych.ward> Feb 21 2006
- Victor Nakoryakov <nail-mail mail.ru> Feb 23 2006
- Alexander Panek <alexander.panek brainsware.org> Feb 23 2006
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
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
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
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









Derek Parnell <derek psych.ward> 