Recent

Author Topic: fpcres now supports compilation of RC files  (Read 861 times)

PascalDragon

  • Hero Member
  • *****
  • Posts: 2103
  • Compiler Developer
fpcres now supports compilation of RC files
« on: August 12, 2020, 11:36:31 pm »
Hello together!

Thanks to the work of Martok the fpcres utility is now able to compile RC files into RES files.

To compile an RC file to a RES file you need to pass the -of res argument as otherwise the RC reader won't be used (it's a "catch all" TResourceReader descendant and thus not registered by default). You can specify include paths for the preprocessor using --include <path> and defines can be declared using -D sym (including defines with values using -D sym=val).

The Free Pascal compiler is capable of using fpcres for resource compilation as well, but due to bootstrapping issues that currently needs to be enabled using a new option -FF. Once a FPC release with a fpcres supporting RC files is released we'll make that option the default and deprecate windres/gorc (I currently plan to merge this into 3.2.1, thus 3.2.2 would support this and future 3.3.1 (and thus 3.4) would then use fpcres by default).

Please test this with your applications and report your problems as this is the biggest change regarding resource compilation since their introduction.

Compatibility note: due to build dependencies the FileInfo unit was moved from fcl-base to fcl-extra, so please keep a look out for stale PPU files.

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: fpcres now supports compilation of RC files
« Reply #1 on: August 13, 2020, 12:45:19 am »
Would it mean that fpc could produce now *.res resource files without the need of windres in Windows and Unix OS system too?

If yes, wow and  many thanks.

Fre;D
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

ASBzone

  • Sr. Member
  • ****
  • Posts: 460
  • Automation leads to relaxation...
    • Free BrainWaveCC Console Utilities
Re: fpcres now supports compilation of RC files
« Reply #2 on: August 13, 2020, 01:30:14 am »
Hello together!

Thanks to the work of Martok the fpcres utility is now able to compile RC files into RES files.

To compile an RC file to a RES file you need to pass the -of res argument as otherwise the RC reader won't be used (it's a "catch all" TResourceReader descendant and thus not registered by default). You can specify include paths for the preprocessor using --include <path> and defines can be declared using -D sym (including defines with values using -D sym=val).

...

Awesome news!   Thanks to Martok and everyone else involved...
-ASB: https://www.BrainWaveCC.com

Lazarus v2.0.11 r63516 / FPC v3.2.1-r46879 (via FpcUpDeluxe) -- Windows 64-bit install w/32-bit cross-compile
Primary System: Windows 10 Pro x64, Version 2004 (Build 19041.388)
Other Systems: Windows 10 Pro x64, Version 2004 or greater

olly

  • New Member
  • *
  • Posts: 18
Re: fpcres now supports compilation of RC files
« Reply #3 on: August 13, 2020, 03:10:59 am »
https://forum.lazarus.freepascal.org/index.php/topic,50796.msg371698.html#msg371698

You weren't kidding! Good job to all!

Off topic, but let's hope we don't have to wait a long time for this to make a official release.  :)

« Last Edit: August 13, 2020, 03:57:36 am by olly »

PascalDragon

  • Hero Member
  • *****
  • Posts: 2103
  • Compiler Developer
Re: fpcres now supports compilation of RC files
« Reply #4 on: August 13, 2020, 09:08:03 am »
Would it mean that fpc could produce now *.res resource files without the need of windres in Windows and Unix OS system too?

Yes, though for now you need to pass the parameter -FF to the compiler so that it uses fpcres instead of windres / gorc.

Off topic, but let's hope we don't have to wait a long time for this to make a official release.  :)

As said the plan is to merge this to 3.2.1, so that the next minor release will contain it, allowing us to switch 3.3.1 to use it by default.

However to make it default we need people to test it with their projects now. It doesn't help if we make it default and later on people complain that we broke everything just because we weren't able to test whatever corner cases they have.

Fred vS

  • Hero Member
  • *****
  • Posts: 1836
    • StrumPract is the musicians best friend
Re: fpcres now supports compilation of RC files
« Reply #5 on: August 13, 2020, 12:39:08 pm »
Would it mean that fpc could produce now *.res resource files without the need of windres in Windows and Unix OS system too?

Yes, though for now you need to pass the parameter -FF to the compiler so that it uses fpcres instead of windres / gorc


Excellent, one step forward for more autonomy, many thanks to Martok and Sven.

Fre;D
« Last Edit: August 13, 2020, 12:42:39 pm by Fred vS »
I use Lazarus 2.0.6 32/64 and FPC 3.2.0 32/64 on Debian 10.2 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64 and Mac OS X Snow Leopard 32.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt, Carbon.

https://github.com/fredvs
https://gitlab.com/fredvs

Polarx79

  • Newbie
  • Posts: 3
Re: fpcres now supports compilation of RC files
« Reply #6 on: August 13, 2020, 07:44:29 pm »
Thanks for all the hard work !! Blessings  :D

 

TinyPortal © 2005-2018