Hello SergioFeitoza.
As mentioned in this link https://stackoverflow.com/questions/13112257/how-can-i-tell-at-compile-time-whether-the-project-is-a-program-or-a-library, probably there is no way to do some compilation time check. What I know is that a ISAPI project is a Library, and a standalone is a program. So, if I need to do that, I would define some mark, as example, ISAPI, to the ISAPI project and PROGRAM to standalone. Then, in my code I would do something like
{$IF Defined(ISAPI)}
//...
{$ELSEIF Defined(PROGRAM)} //Or just $ELSE, as there is just two options.
//...
{$ENDIF}
Edit: If your project's source code first line is LIBRARY, then, it is an ISAPI project.