I am using Delphi XE2 and I have a program that can be compiled as Win32 EXE or ISAPI DLL. That works fine.
However my problem is how to conditionally compile.
{$include MyConditionals.Inc}
{$ifdef ISAPISERVER}
library
{$else}
program
{$endif}
MyProgram;
That works, but the FILE extension is getting wrong. It generates an EXE extension always. I need that when selected the library condition to have the DLL extension generated.
How can easily change the condition and have the right extension?
AFAIK you can't use a conditional compilation to change the extension of the binary. The extension of the file is set in the build process depending of the value (Application, Library, Console) for the AppType
entry in the .dproj file. My recommendation is create a build batch file for the dll and another for the application.