developer-delphi-programming-conditional-defines

Configure Delphi and Free Pascal conditional compilation directives for engines and modules.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-programming-conditional-defines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: developer-delphi-programming-conditional-defines
Source: https://github.com/cslsoftwares/ParamentersORM/tree/main/.cursor/skills/developer-delphi-programming-conditional-defines_V1.0.0
Command: npx skills add https://github.com/cslsoftwares/ParamentersORM --skill developer-delphi-programming-conditional-defines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Managing build-time toggles across Delphi and Free Pascal projects can be error-prone without a canonical approach to engines and modules. This skill provides guidance on enabling/disabling engines (USE_UNIDAC, USE_FIREDAC, USE_ZEOS, USE_SQLDB) and modules (USE_PARAMENTERS, USE_LOGGERS, USE_POOLCONNECTIONS, USE_ATTRIBUTES, USE_ENTITY_MANAGER, USE_QUERY_BUILDER) via compile-time directives and ORM.Defines.inc, ensuring cross-compiler compatibility.

Core Features & Use Cases

  • Canonical guidance for organizing conditional blocks and engine activation in both Delphi and FPC projects.
  • Clear rules for the order of engine checks (UNIDAC → FIREDAC → ZEOS → SQLDB) and safe fallbacks in {$IF DEFINED(...)} blocks.
  • Use cases include multi-target builds, feature toggling for optional modules, and ensuring consistent builds across compilers.

Quick Start

Read the canonical Diretivas de Compilação document and apply the dictated order and nesting of {$IF DEFINED(...)} blocks for your current engine/module configuration.

Frequently Asked Questions about developer-delphi-programming-conditional-defines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Delphi conditional defines to switch between database engines like UNIDAC and FIREDAC?

Delphi conditional defines let you toggle database engines by checking directives in a specific order: UNIDAC, FIREDAC, ZEOS, then SQLDB. You place these {$IF DEFINED(...)} blocks in an ORM.Defines.inc file to safely enable or disable engines at compile time across projects.

What is the correct order for checking conditional compilation directives in Free Pascal and Delphi projects?

The correct order for checking conditional compilation directives is UNIDAC, FIREDAC, ZEOS, then SQLDB. Following this canonical sequence in your {$IF DEFINED(...)} blocks ensures safe fallbacks and consistent engine activation across both Delphi and Free Pascal compilers.

Can I use the same conditional defines file for cross-compiler builds between Delphi and FPC?

Yes, you can use a canonical ORM.Defines.inc file for cross-compiler builds between Delphi and FPC. This approach provides a safe, shared pattern for {$IF DEFINED(...)} blocks, ensuring consistent feature toggling and engine activation across both compilers.

How do I enable optional modules like USE_ENTITY_MANAGER and USE_QUERY_BUILDER at compile time?

You enable optional modules like USE_ENTITY_MANAGER and USE_QUERY_BUILDER by declaring them as conditional defines within your ORM.Defines.inc file. This compile-time directive approach also applies to USE_ATTRIBUTES, USE_PARAMENTERS, USE_LOGGERS, and USE_POOLCONNECTIONS.

What is the best way to organize conditional compilation blocks for multi-target Delphi builds?

The best way to organize conditional compilation blocks is by consolidating them into a canonical ORM.Defines.inc file. This enforces the dictated engine check order and safe nesting patterns for {$IF DEFINED(...)} blocks, ensuring reliable multi-target builds.

Why do my conditional compilation directives fail to switch engines correctly in Free Pascal?

Conditional compilation directives fail to switch engines correctly when the canonical check order is ignored. You must verify that your {$IF DEFINED(...)} blocks follow the UNIDAC to SQLDB sequence and include proper fallbacks within your ORM.Defines.inc file.