News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

How to deliver options to resource compiler ?

Started by Frank3000, December 19, 2005, 01:59:07 PM

Previous topic - Next topic

Frank3000

Hello,
I'm trying to compile the zlib library with codeblocks (rev. 1562).
I need to pass the -DGCC_WINDRES option to windres.exe otherwise I
get a syntax error in zlib1.rc. Where is this possible ?
(except at programs tab direct after windres.exe)

Frank
Klingon multitasking systems do not support 'time-sharing'. When a Klingon program wants to run,
it challenges the scheduler in hand-to-hand combat and owns the machine.

jimp

CodeBlocks has no option to send options to the resource compiler (but probably should).  You can put the option in Compiler Settings, Other, Advanced options, Compile Win32 Resource File,  or  as you said after windres.exe.  Doing this will send it to all programs compiled with the resource compiler.

What does GCC need that other resource compilers don't?  Resource files don't usually contain options that are compiler specific.

thomas

Hmm... not implemented, sorry.

But, does the resource compiler not support #include?
I think it does... Then you could #include "foo.h" and put #define GCC_WINDRES in there...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Frank3000

Thx for your answer.

Quote from: jimp on December 21, 2005, 09:02:22 PM
Resource files don't usually contain options that are compiler specific.

Yes, I haven't seen that before either.

Quote
#ifdef GCC_WINDRES
VS_VERSION_INFO      VERSIONINFO
#else
VS_VERSION_INFO      VERSIONINFO   MOVEABLE IMPURE LOADONCALL DISCARDABLE
#endif
Klingon multitasking systems do not support 'time-sharing'. When a Klingon program wants to run,
it challenges the scheduler in hand-to-hand combat and owns the machine.

Frank3000

Quote from: thomas on December 21, 2005, 10:01:50 PM
Hmm... not implemented, sorry.

But, does the resource compiler not support #include?
I think it does... Then you could #include "foo.h" and put #define GCC_WINDRES in there...

O.k. but if I wanted to change the source file I could just remove the #if part.
:D
Klingon multitasking systems do not support 'time-sharing'. When a Klingon program wants to run,
it challenges the scheduler in hand-to-hand combat and owns the machine.

grv575

The #defines tab is the proper place to define preprocessor flags (-Dflag), regardless of the tool which handles preprocessing (gcc or windres).  I don't see why putting GCC_WINDRES here wouldn't not be the right thing to do, as other stages shouldn't be checking for that flag anyway.

jimp

Quote from: grv575 on December 22, 2005, 02:05:54 AM
The #defines tab is the proper place to define preprocessor flags (-Dflag), regardless of the tool which handles preprocessing (gcc or windres).

Options in the #defines tab are not passed to the resource compiler(windres).  They are passed only to the source code compiler(g++).