User forums > General (but related to Code::Blocks)

windres option for mingw64

<< < (2/2)

G-Shadow:
Sorry for resurrecting this old topic. I had some problem and found other solution. While googling for solution, I found this topic is on the top, so I decided to answer here so that other could find my solution.
In my case I had two targets: x86 and x64, so I could not set global toolchain flags. My solution for per-target windres options:

1) In project build options add new "custom variable" for every windows target (in my case it is Debug-Win32, Release-Win32, Debug-Win64 and Release-Win64).

2) Give it some name (I used "rc_arch") and set value to "pe-i386" for x86 (win32) targets and "pe-x86-64" for x64 targets.

3) Click "properties" on the resource .rc file, select "Advanced" tab, check "Use custom command..." checkbox and copy default command from the hint below. Then add one more option: -F $rc_arch

In my case it looks like that: $rescomp $res_includes -J rc -O coff -F $rc_arch -i $file -o $resource_output

If you need other windres options, you could simply remove "-F" and rename $rc_arch to something line $rc_options and the add any target specific options for windres. Hope this helps to someone.

MortenMacFly:
The next nightly will have this implemented natively so you can set/change these options on a per project/target level or within the global compiler options.

G-Shadow:
It`s a good news. Thank you very much, I`ll try it today!

Navigation

[0] Message Index

[*] Previous page

Go to full version