Resource compiler and configuration

Resource compiler and configuration

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 帖子 / 0 new
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
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
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.

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

登陆并发表评论。