Resource compiler and configuration

Resource compiler and configuration

Bild des Benutzers netphilou31

Hi,

Is it possible to identify, in a resource script file, which configuration is currently being built (Win32, x64,...) ?

Is there an internal variable or constant that can be used for this purpose ?
I would like to use different resources depending on the configuration.

Thanks,
Phil.

4 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.
Bild des Benutzers Steve Lionel (Intel)

You can use typical C-style conditional compilation directives, such as #ifdef, in a resource script. It doesn't appear that VS adds any /d options to the rc command line for configuration name, but you can right click on the resource file in the project, select Properties, and add a predefined macro name of your own. This is per-configuration, so you can have DEBUG in one and RELEASE in the other. Then you cn use #ifdef to control things.

Steve
Bild des Benutzers netphilou31

Hi steve,
Thanks for the information.
I have tried and it works well. However I would like to know if the compiler creates internal variables that could be directly used inside the resource script to avoid the need to manually add them in the build settings of the .rc file (mainly to identify the target plaftorm Win32 or x64).

Best regards,
Phil.

Bild des Benutzers Steve Lionel (Intel)

The resource compiler is a Microsoft tool - Visual Studio does not, on its own, pass predefined identifiers to the RC step.

Steve

Melden Sie sich an, um einen Kommentar zu hinterlassen.