Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-12

Distributing unit object files

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andrew Brunner

I'm needing to figure out how best to "close" or "seal" units so that I can use the compiled unit object files instead of the actual unit files.

The problem is that the compiled unit files call a few units that the project has the source to. And FPC is looking to recompile the compiled object file because a CRC has changed for a contributing unit that was used when the unit object file was created.

How do I make FPC not rebuild the unit object file when contributing units to the compiled unit have been modified? What is the best strategy - if at all?

Reply by email

Jonas Maebe
to Andrew Brunner
Andrew Brunner wrote 7 lines
project has the source to. And FPC is looking to recompile the compiled object file because a CRC has changed for a contributing unit that was used when the unit object file was created. How do I make FPC not rebuild the unit object file when contributing units to the compiled unit have been modified? What is the best strategy - if at all?

You can try compiling your units with -Ur, which will tell the compiler that it should try not to recompile those units. That won't help if the CRC of a unit they depend on has changed though. The reason is that a changed CRC means that something in the interface of that other unit has changed, which in turn may have an effect on the current unit (it may call routines that no longer exist, use constants whose value has changed, override methods that are now located in a different VMT slot, etc).

Jonas

Reply by email

Ludo Brands
to Andrew Brunner: I'm needing to figure out how best to "close" or "seal" units so that I can use the…
How do I make FPC not rebuild the unit object file when contributing units to the compiled unit have been modified? What is the best strategy - if at all?

If the contributing unit is a stand-alone unit which doesn't depend on other units (fe. a database connector), you can copy the source codes of that unit into your project. This way you'll basically freeze the code of that unit and remove the external dependency. Evaluate carefully the pros and cons before doing so.

Ludo

Reply by email