Wrong unit search path when using relative path for output binary
Original Reporter info from Mantis: DonAlfredo @DonAlfredo
-
Reporter name: Alfred
Original Reporter info from Mantis: DonAlfredo @DonAlfredo
- Reporter name: Alfred
Description:
When creating a new Lazarus project with Lazarus itself, a nice -FU is created:
lib$(TargetCPU)-$(TargetOS)
As standard practice, the above can also be used for the binary output -o:
bin$(TargetCPU)-(TargetOS)\$NameOnly(
(ProjFile))
Setting the binary output to a relative path works well except for the inclusion of other unit files -Fu !
The resulting FPC link*.res file is created inside the bin directory. It uses the command line as created by Lazarus. Lazarus adds the -Fu options as a relative path relative to the original lpi-file. Lazarus should add them relative to the binary output path, where all the linking happens.
Example.
If the project has an extra unit named unit2.pas inside a directory myextraunit, this directory is included as ".\myunit". But this directory will never be found due to the fact that the linking happens inside the binary path "\bin$(TargetCPU)-$(TargetOS)"
Additional information:
The -Fu options are added inside ConvertSearchPathToCmdLine. The are included as-is. However, this inclusion should use the correct relative paths, or switch towards absolute paths, as is done with the binary output -o.
Mantis conversion info:
- Mantis ID: 38170
- Monitored by: » @trevoz (Trevor Roydhouse)
- Target version: 2.2