emailx45
Programmer
- Jan 10, 2025
- 6
- Firstly, the Delphi allow that define some params in your code itself.
- Second, you can use the options your IDE to define too, but in code it's more flexible...
Code:
library Project1;
uses
System.SysUtils,
System.Classes;
// ...
{$R *.res}
// ----------------------------------------------------------------------- //
// automatically change the names when compiling in 32bits/64bits
//
// Define on "DPR" file:
//
{$IFDEF WIN32}
{$LIBPREFIX 'Hello_'}
{$LIBSUFFIX '_32bit_'}
{$LIBVERSION '_World'}
{$ENDIF}
// {$ELSE} ---> if not 32, what it will be?
{$IFDEF WIN64}
{$LIBPREFIX 'Hello_'}
{$LIBSUFFIX '_64bit_'}
{$LIBVERSION '_World'}
{$ENDIF}
//DLL, EXE, etc..
{$EXTENSION 'MyNewExtForProject'} = 'xxxxxx.MyNewExtForProject'
//
// to another platforms see on HELP about "Compiler Directives"
// ----------------------------------------------------------------------- //
begin
// ... your code
end.