[fpc-pascal] set output directory for resources
Vincent Snijders
vsnijders at quicknet.nl
Wed May 2 23:49:07 CEST 2007
Vincent Snijders schreef:
> Hi,
> =
> If I compile a unit which contains {$R wincemenures.res} a file named =
> wincemenures.or is created in the source directory, even if I have set =
> -FU or -FE. What parameter do I need to pass to the compile to move the =
> .or file to the unit output directory?
Nobody answered, so I decided to dive into the compiler source myself =
and I think always the source directory is used.
Attached patch changes this to the output directory of the currently =
compiled module. Is this ok?
Vincent
-------------- next part --------------
Index: comprsrc.pas
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- comprsrc.pas (revision 7246)
+++ comprsrc.pas (working copy)
@@ -89,9 +89,9 @@
current_settings.globalswitches:=3Dcurrent_settings.globalswitches+[c=
s_link_nolink];
end;
srcfilepath:=3DExtractFilePath(current_module.mainsource^);
+ resobj:=3Dcurrent_module.outputpath^+ChangeFileExt(ExtractFileName(fname=
),target_info.resobjext);
if not path_absolute(fname) then
fname:=3Dsrcfilepath+fname;
- resobj:=3DChangeFileExt(fname,target_info.resobjext);
s:=3Dtarget_res.rescmd;
ObjUsed:=3D(pos('$OBJ',s)>0);
Replace(s,'$OBJ',maybequoted(resobj));
More information about the fpc-pascal
mailing list