mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-25 01:18:52 +02:00
* pass parameters to windres using short path names and forward slashes (issue #12645)
git-svn-id: trunk@12545 -
This commit is contained in:
parent
3d8388fd22
commit
a3fcf74c4d
@ -238,13 +238,34 @@ var
|
|||||||
preprocessorbin,
|
preprocessorbin,
|
||||||
s : TCmdStr;
|
s : TCmdStr;
|
||||||
arch : ansistring;
|
arch : ansistring;
|
||||||
|
|
||||||
|
function WindresFileName(filename: TCmdStr): TCmdStr;
|
||||||
|
// to be on the safe side, only give short file names with forward slashes to
|
||||||
|
// windres
|
||||||
|
var
|
||||||
|
i: longint;
|
||||||
|
begin
|
||||||
|
Result := GetShortName(filename);
|
||||||
|
for I:=1 to Length(Result) do
|
||||||
|
if Result[I] in AllowDirectorySeparators then
|
||||||
|
Result[i]:='/';
|
||||||
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
srcfilepath:=ExtractFilePath(current_module.mainsource^);
|
srcfilepath:=ExtractFilePath(current_module.mainsource^);
|
||||||
if output=roRES then
|
if output=roRES then
|
||||||
begin
|
begin
|
||||||
s:=target_res.rccmd;
|
s:=target_res.rccmd;
|
||||||
Replace(s,'$RES',maybequoted(OutName));
|
if target_res.rcbin = 'windres' then
|
||||||
Replace(s,'$RC',maybequoted(fname));
|
begin
|
||||||
|
Replace(s,'$RES',WindresFileName(OutName));
|
||||||
|
Replace(s,'$RC',WindresFileName(fname));
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
Replace(s,'$RES',maybequoted(OutName));
|
||||||
|
Replace(s,'$RC',maybequoted(fname));
|
||||||
|
end;
|
||||||
ObjUsed:=False;
|
ObjUsed:=False;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -272,7 +293,7 @@ begin
|
|||||||
if fCollectCount=0 then
|
if fCollectCount=0 then
|
||||||
s:=s+' '+maybequoted(fname)
|
s:=s+' '+maybequoted(fname)
|
||||||
else
|
else
|
||||||
s:=s+' @'+fScriptName;
|
s:=s+' @'+maybequoted(fScriptName);
|
||||||
end;
|
end;
|
||||||
{ windres doesn't like empty include paths }
|
{ windres doesn't like empty include paths }
|
||||||
if respath='' then
|
if respath='' then
|
||||||
@ -280,12 +301,12 @@ begin
|
|||||||
Replace(s,'$INC',maybequoted(respath));
|
Replace(s,'$INC',maybequoted(respath));
|
||||||
if (output=roRes) and (target_res.rcbin='windres') then
|
if (output=roRes) and (target_res.rcbin='windres') then
|
||||||
begin
|
begin
|
||||||
if (srcfilepath<>'') then
|
|
||||||
s:=s+' --include '+maybequoted(srcfilepath);
|
|
||||||
{ try to find a preprocessor }
|
{ try to find a preprocessor }
|
||||||
preprocessorbin := respath+'cpp'+source_info.exeext;
|
preprocessorbin := respath+'cpp'+source_info.exeext;
|
||||||
if FileExists(preprocessorbin,true) then
|
if FileExists(preprocessorbin,true) then
|
||||||
s:=s+' --preprocessor='+preprocessorbin;
|
s:='--preprocessor='+preprocessorbin+' '+s;
|
||||||
|
if (srcfilepath<>'') then
|
||||||
|
s:='--include '+WindresFileName(srcfilepath)+' '+s;
|
||||||
end;
|
end;
|
||||||
Result:=s;
|
Result:=s;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user