Hello,
I would use macro conditions, but I fail.
Below, the code that I use of custom system.pas:
{$ifdef winexe}procedure main; stdcall; [public, alias: '_mainCRTStartup' ];{$endif}
{$ifdef windll}procedure main; stdcall; [public, alias: '_DLLMainCRTStartup'];{$endif}
begin
PascalMain;
end;
with this command line options (in a console batch file):
set prjdir=D:\a\TinyRTL\TinyRTL\src
set fpc=ppcrossx64.exe
set fpcsrc=^
-Fi%prjdir%\sources\fpc-sys ^
-Fi%prjdir%\sources\fpc-win ^
-Fi%prjdir%\sources\fpc-rtl ^
-Fi%prjdir%\sources\fpc-gnu ^
-Fi%prjdir%\sources\fpc-qt ^
^
-Fu%prjdir%\sources\fpc-sys ^
-Fu%prjdir%\sources\fpc-win ^
-Fu%prjdir%\sources\fpc-rtl ^
-Fu%prjdir%\sources\fpc-gnu ^
-Fu%prjdir%\sources\fpc-qt
set fpcEXEx64=^
-n -Mdelphi -Twin64 -dwindows -dwin64 -O3 -Os -Anasmwin64 -a ^
-dNoRTTI -Xs -g
set fpcDLLx64=^
-fPIC -CD -WD -Xm -Xc -Xg
set fpcexe=%fpc% %fpcsrc% %fpcEXEx64%
set fpcdll=%fpc% %fpcsrc% %fpcEXEx64% %fpcDLLx64%
%fpcdll% -dwindll testdll.pas -otest1.dll
%fpcexe% -dwinexe test1.pas -otest1.exe
The error that pop out is:
test1.pas(33,36) Error: Entrypoint _mainCRTStartup not defined