Delphi Rocks
Delphi Rocks

Reputation: 90

How to compile for different product editions?

At work, I have Delphi Enterprise, and at home I have Delphi Professional. My project contains FireDAC connections for Firebird and MS-SQL.

The problem is, FireDAC for MS-SQL is only included in Delphi Enterprise, but not in Delphi Professional.

Now, I would like to add some ifdef statements.

Does something like ifdef PRO or ifdef ENT exist?

Upvotes: 1

Views: 109

Answers (1)

Remy Lebeau
Remy Lebeau

Reputation: 595896

Edition-based conditionals do not exist at compile-time. If you need that, you will have to create separate projects (or at least multiple build configurations in a single project) that define their own conditions, and then you can {$IFDEF} on those instead.

However, at run-time, you can detect the edition used to compile your app, by having your app's code access the DVCLAL (Delphi Visual Component Library Access License) resource that the compiler automatically creates in you executable. See Delphi signature in exe files and What are the list of all possible values for DVCLAL? for more details.

Upvotes: 1

Related Questions