digitalmars.D - "version" predefined pragma
- Dave (9/9) Feb 21 2006 Along the same lines as pragma(lib,...) I'm wondering if it would make s...
- Derek Parnell (17/29) Feb 21 2006 You can do this sort of thing with Build.
- Victor Nakoryakov (7/21) Feb 23 2006 Because there is to only dmd compiler, and there are different switches
- Alexander Panek (8/29) Feb 23 2006 version(DigitalMars) {
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:5You 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:5Because 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:version(DigitalMars) { pragma(switch,..); version(...) { pragma(..); } } Good enough, I guess.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:5Because there is to only dmd compiler, and there are different switches for different compilers.
Feb 23 2006