* Set subtarget define as soon as -t option is parsed

This commit is contained in:
Michaël Van Canneyt 2023-12-20 12:15:17 +01:00
parent e076c6fc59
commit f232009010

View File

@ -4277,7 +4277,8 @@ procedure TPas2jsCompiler.SetSubTarget(AValue: String);
begin begin
if FSubTarget=AValue then Exit; if FSubTarget=AValue then Exit;
FSubTarget:=AValue; FSubTarget:=AValue;
// AddDefine('FPC_SUBTARGET',SubTarget);
AddDefine('FPC_SUBTARGET_'+Uppercase(SubTarget));
end; end;
function TPas2jsCompiler.CreateImportList: TJSSourceElements; function TPas2jsCompiler.CreateImportList: TJSSourceElements;
@ -4611,8 +4612,10 @@ begin
AddDefine('STR_CONCAT_PROCS'); AddDefine('STR_CONCAT_PROCS');
AddDefine('UNICODE'); AddDefine('UNICODE');
if SubTarget<>'' then if SubTarget<>'' then
begin
AddDefine('FPC_SUBTARGET',SubTarget); AddDefine('FPC_SUBTARGET',SubTarget);
AddDefine('FPC_SUBTARGET_'+Uppercase(SubTarget));
end;
FHasShownLogo:=false; FHasShownLogo:=false;
FHasShownEncoding:=false; FHasShownEncoding:=false;
FFS.Reset; FFS.Reset;