From b88d12c7b9e35798bac97672a92ed9bda401696e Mon Sep 17 00:00:00 2001 From: svenbarth Date: Wed, 12 Aug 2020 19:08:25 +0000 Subject: [PATCH] + add option -FF to force the use of fpcres as RC compiler Note: if we merge this to 3.2.x then we can switch to this by default once 3.2.2 is released git-svn-id: trunk@46398 - --- compiler/comprsrc.pas | 22 ++++++++++++++++------ compiler/options.pas | 2 ++ compiler/rescmn.pas | 3 +++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/compiler/comprsrc.pas b/compiler/comprsrc.pas index 04552c6fa6..c8da1265fa 100644 --- a/compiler/comprsrc.pas +++ b/compiler/comprsrc.pas @@ -78,13 +78,14 @@ procedure CollectResourceFiles; Var ResCompiler : String; RCCompiler : String; + RCForceFPCRes : Boolean; implementation uses SysUtils, cutils,cfileutl,cclasses, - Globtype,Globals,Verbose,Fmodule, comphook,cpuinfo; + Globtype,Globals,Verbose,Fmodule, comphook,cpuinfo,rescmn; {**************************************************************************** TRESOURCEFILE @@ -126,7 +127,10 @@ var begin if output=roRES then begin - s:=target_res.rccmd; + if RCForceFPCRes then + s:=FPCResRCArgs + else + s:=target_res.rccmd; Replace(s,'$RES',maybequoted(OutName)); Replace(s,'$RC',maybequoted(fname)); ObjUsed:=False; @@ -162,7 +166,10 @@ var begin Result:=true; if output=roRES then - Bin:=SelectBin(RCCompiler,target_res.rcbin) + if RCForceFPCRes then + Bin:=SelectBin(RCCompiler,FPCResUtil) + else + Bin:=SelectBin(RCCompiler,target_res.rcbin) else Bin:=SelectBin(ResCompiler,target_res.resbin); if bin='' then @@ -265,8 +272,11 @@ begin srcfilepath:=ExtractFilePath(current_module.mainsource); if output=roRES then begin - s:=target_res.rccmd; - if target_res.rcbin = 'windres' then + if RCForceFPCRes then + s:=FPCResRCArgs + else + s:=target_res.rccmd; + if (target_res.rcbin = 'windres') and not RCForceFPCRes then Replace(s,'$RC',WindresFileName(fname)) else Replace(s,'$RC',maybequoted(fname)); @@ -317,7 +327,7 @@ begin if respath='' then respath:='.'; Replace(s,'$INC',maybequoted(respath)); - if (output=roRes) and (target_res.rcbin='windres') then + if (output=roRes) and (target_res.rcbin='windres') and not RCForceFPCRes then begin { try to find a preprocessor } preprocessorbin := respath+'cpp'+source_info.exeext; diff --git a/compiler/options.pas b/compiler/options.pas index b77220e47a..a71e0b62c3 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -1700,6 +1700,8 @@ begin frameworksearchpath.AddPath(More,true) else IllegalPara(opt); + 'F' : + RCForceFPCRes:=true; 'i' : begin if ispara then diff --git a/compiler/rescmn.pas b/compiler/rescmn.pas index 60de2d28a6..64aa1d690d 100644 --- a/compiler/rescmn.pas +++ b/compiler/rescmn.pas @@ -65,6 +65,9 @@ uses resflags : [res_external_file]; ); + FPCResRCArgs = '--include $INC -of res -D FPC -o $RES $RC'; + FPCResUtil = 'fpcres'; + implementation