Compiling in windows resources (and DSSS)
Bill Baxter
dnewsgroup at billbaxter.com
Sat Nov 17 16:59:01 PST 2007
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
More information about the Digitalmars-d-learn
mailing list