www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Compiling in windows resources (and DSSS)

reply Bill Baxter <dnewsgroup billbaxter.com> writes:
What's the best way to compile in .ico and .rc stuff?
Does dmd on Windows do any of that for you?

I found that I could call  "rcc resources.rc" and then add the resulting 
.res file to the dmd command.  Is there a better way?

And for using DSSS how would I add that rc step?  Anything better than 
this?:

[main.d]
    prebuild = echo "Compiling resources..."; rcc main.rc
    buildflags += main.res
Nov 17 2007
next sibling parent reply Derek Parnell <derek psych.ward> writes:
On Sun, 18 Nov 2007 06:53:59 +0900, Bill Baxter wrote:

 What's the best way to compile in .ico and .rc stuff?
 Does dmd on Windows do any of that for you?
 
 I found that I could call  "rcc resources.rc" and then add the resulting 
 .res file to the dmd command.  Is there a better way?
 
 And for using DSSS how would I add that rc step?  Anything better than 
 this?:
 
 [main.d]
     prebuild = echo "Compiling resources..."; rcc main.rc
     buildflags += main.res
I know you were not after Bud's way of doing this but here it is anyhow ... First you have these lines in the 'Rule Definition File' (default.rdf) ... ----- Windows Resource Compiler -------- This uses pragma( build, "<sourcefile>.rc"); ---------------- rule=Resources in=rc out=res tool=rc /r { IN} /fo { OUT} Then in your source code you would have something like ... version(build) pragma(build, "main.rc"); -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Nov 17 2007
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Derek Parnell wrote:
 On Sun, 18 Nov 2007 06:53:59 +0900, Bill Baxter wrote:
 
 What's the best way to compile in .ico and .rc stuff?
 Does dmd on Windows do any of that for you?

 I found that I could call  "rcc resources.rc" and then add the resulting 
 .res file to the dmd command.  Is there a better way?

 And for using DSSS how would I add that rc step?  Anything better than 
 this?:

 [main.d]
     prebuild = echo "Compiling resources..."; rcc main.rc
     buildflags += main.res
I know you were not after Bud's way of doing this but here it is anyhow ... First you have these lines in the 'Rule Definition File' (default.rdf) ... ----- Windows Resource Compiler -------- This uses pragma( build, "<sourcefile>.rc"); ---------------- rule=Resources in=rc out=res tool=rc /r { IN} /fo { OUT} Then in your source code you would have something like ... version(build) pragma(build, "main.rc");
Thanks. Why does bud need to have such a verbose setup? Compared to that I feel pretty happy with the 2-line config for dsss. I see bud also some other useful pragmas for doing Windows things like build_def to set the gui/console flavor. But yeh, I kind of gave up on bud sometime in 2006 when I sent you that patch for supporting environment variables, you told me thanks, but you already implemented it, and then no new release of bud with that feature ever materialized. --bb
Nov 17 2007
parent Derek Parnell <derek psych.ward> writes:
On Sun, 18 Nov 2007 09:59:01 +0900, Bill Baxter wrote:

 Derek Parnell wrote:
 On Sun, 18 Nov 2007 06:53:59 +0900, Bill Baxter wrote:
 
 What's the best way to compile in .ico and .rc stuff?
 Does dmd on Windows do any of that for you?

 I found that I could call  "rcc resources.rc" and then add the resulting 
 .res file to the dmd command.  Is there a better way?

 And for using DSSS how would I add that rc step?  Anything better than 
 this?:

 [main.d]
     prebuild = echo "Compiling resources..."; rcc main.rc
     buildflags += main.res
I know you were not after Bud's way of doing this but here it is anyhow ... First you have these lines in the 'Rule Definition File' (default.rdf) ... ----- Windows Resource Compiler -------- This uses pragma( build, "<sourcefile>.rc"); ---------------- rule=Resources in=rc out=res tool=rc /r { IN} /fo { OUT} Then in your source code you would have something like ... version(build) pragma(build, "main.rc");
Thanks. Why does bud need to have such a verbose setup?
Because. The stuff in the RDF file is a once off. Then each program that is dependant on a resource just has the single line of code. Too complex for you? Okay, I can live with that.
  Compared to 
 that I feel pretty happy with the 2-line config for dsss.  I see bud 
 also some other useful pragmas for doing Windows things like build_def 
 to set the gui/console flavor.
 
 But yeh, I kind of gave up on bud sometime in 2006 when I sent you that 
 patch for supporting environment variables, you told me thanks, but you 
 already implemented it, and then no new release of bud with that feature 
 ever materialized.
I'm dead lazy I guess. I have done all that environment stuff and more, but no one's paying me enough to drop more important things to finalise the docs etc... I've actually be done a couple of 36-hour days recently to meet paying deadlines and I'm actually just taking a break now (9:30pm Sunday) in what's looking like another all nighter. But hey! life's good right?! Especially when considering the alternative. -- Derek Parnell Melbourne, Australia skype: derek.j.parnell
Nov 18 2007
prev sibling parent reply BLS <nanali nospam-wanadoo.fr> writes:
Sorry Bill, no help. Just a question / Can you please publish a sample 
dsss.conf for a Windows GUI application ? Gregor is afaik not really a 
fanatic Win user...
Bjoern

Bill Baxter schrieb:
 What's the best way to compile in .ico and .rc stuff?
 Does dmd on Windows do any of that for you?
 
 I found that I could call  "rcc resources.rc" and then add the resulting 
 ..res file to the dmd command.  Is there a better way?
 
 And for using DSSS how would I add that rc step?  Anything better than 
 this?:
 
 [main.d]
    prebuild = echo "Compiling resources..."; rcc main.rc
    buildflags += main.res
Nov 18 2007
parent Lutger <lutger.blijdestijn gmail.com> writes:
BLS wrote:
 Sorry Bill, no help. Just a question / Can you please publish a sample 
 dsss.conf for a Windows GUI application ? Gregor is afaik not really a 
 fanatic Win user...
 Bjoern
[winapp.d] buildflags = -gui
Nov 18 2007