How to compile only one .PAS file while ignoring the UNIT dependencies declared in the USES clause ?
-----
Cristiano Barbosa

Mailing lists / pas2js / 2020-12
8 messages · 5 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
How to compile only one .PAS file while ignoring the UNIT dependencies declared in the USES clause ?
-----
Cristiano Barbosa
cbsistem wroteHow to compile only one .PAS file while ignoring the UNIT dependencies declared in the USES clause ?
Sorry, but that question doesn't make any sense. Either the units in the USES clause are referenced in some way in the code or they are not.
If they are not referenced, you can delete the USES clause or at least comment them out.
If you do this when they are in fact referenced, then you .PAS file simply won't compile. Very basic Pascal concept that everything that is being referenced has to be defined first...
Ralf
I agree it doesn't make sense, and I don't know specifically for pas2js, but usually specifying a unit in the uses clause can have an impact even if the code doesn't make any reference to the code of this unit, if the unit has an initialization part.
I think for example to the cthreads unit used in Linux for threads ( https://www.freepascal.org/docs-html/current/rtl/cthreads/index.html ), or the memory manager for memory allocation (
https://www.freepascal.org/docs-html/current/prog/progsu175.html ).
How to compile only one .PAS file while ignoring the UNIT dependencies declared in the…
cbsistem wroteHow to compile only one .PAS file while ignoring the UNIT dependencies declared in the USES clause ?
Lazarus has the quick syntax check option.
That's the best you can do.
To actually compile, you must compile the dependencies.
Michael.
I agree it doesn't make sense, and I don't know specifically for pas2js, but usually…
But that is the opposite of the scenario that you described.
Even if the reference is only indirect, by the initialization section of a used unit, you can remove it from the uses clause. Then still no code of that unit would be required to compile the file you are mentioned...
Ralf
The intention would be to compile the paschal unit that is being altered without having to compile the entire project, to have more performance.
Pas2js could compile the Paschal Unit into a .JS file with the same name. Without packaging all UNITS.
Is there any way to improve performance by compiling only the unit that was changed?
-----
Cristiano Barbosa
I realize that there are no ppu generated with pas2js
The intention would be to compile the paschal unit that is being altered without having…
Yes. Leave out -Jc
Is there any way to improve performance by compiling only the unit that was changed?
Not yet.
You can use -Ju instead of -Fu.
Mattias