Jump to content
chkaufmann

Conditional Define for Packages

Recommended Posts

Hi,

 

I use FastMM5 in a unit for logging, however I don't want this unit/code to be compiled into my IDE package.

 

Is there a predefined constant for an IFDEF to see if my unit is compiled in an application or into a package? Or do I have to create my own constant for this?

 

Christian

Share this post


Link to post

"Package-specific Compiler Directives" help topic. However it doesn't contain anything like "IFDEF PACKAGE". I'm afraid there's no straight way to do it, only some kinds of workarounds

Edited by Fr0sT.Brutal

Share this post


Link to post

This is not what I need. I need a constant so I can exclude code (and put some dummy code) when the unit goes to the package.

 

Christian

Share this post


Link to post

It is what you need, consider how you are building the package, specifically the run time and design time flags you are setting, use the above:

2 hours ago, Fr0sT.Brutal said:

"Package-specific Compiler Directives"

Test the mix of $DESIGNONLY and $RUNONLY that fits your usage.

  • Like 1

Share this post


Link to post
9 hours ago, chkaufmann said:

Is there a predefined constant for an IFDEF to see if my unit is compiled in an application or into a package?

No, there is not.  You would have to create your own conditional in the Package's project options.

9 hours ago, chkaufmann said:

Or do I have to create my own constant for this?

Yes.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×