[fpc-pascal] uses myunit in '../src/myunit.pas' ?

Michael Van Canneyt michael at freepascal.org
Tue Feb 14 21:47:15 CET 2017



On Tue, 14 Feb 2017, fredvs wrote:

>> Please simply use "{$unitpath }"
>
> Huh, Mattias present me yesterday a beautiful "{$unitpath }".
>
> We played together all the night, without any trouble.
>
> And this morning Matt said that I may not trust in {$unitpath }, that I will
> only have problems, that I should think at something else. ;-(

He is correct.

But you insist on doing things wrong (in my opinion), 
so I oblige you by presenting you what I consider to be 
the least harmful option that still has a chance of earning your approval.

>
>> or use a lazarus project or fpc.
>
> The game is to do everything inside code, without external tools. (for
> old-way people like me that love to use console and old-fashion editors).

I am also old-way, and I also use the console.

But configuration management simply does not belong in the source code.
You can use fpmake if you want to write pascal code for your configuration
management. It exists for this exact purpose, and I should know, I invented it.

So, you already have plenty of options to do what you want in a file:

- lazarus project (lazbuild can perfectly be used outside the IDE)
- fppkg
- fpmake
- $unitpath
- use a per-project config file. Also a very recommended option (see e.g. fpgui)
- Probably mseide also gives you some extra options.

Given this wide range of existing tried-and-tested options, 
there is really no need to burden the compiler with another option.

Michael.



More information about the fpc-pascal mailing list