Recent

Author Topic: Extending IDE: Adding package to project and project-packages  (Read 1802 times)

Pascal

  • Hero Member
  • *****
  • Posts: 932
I am currently upgrading LazProfiler for supporting profiling of project-packages.

To compile the project with profiling code i have to add a runtime unit to the project and the project-packages.

I have three options:
a) copy the units to all directories (project and project-packages)
b) add path to the LazProfiler-package to OtherUnitPath of the project and the project-packages
c) create a LazProfiler runtime package and add it to the project and the project-packages

a) and b) only work if the project but not the project-packages are profiled. The problem seems to be the different places
where my runtime ppu is stored (project-dir/lib vs package-dir/lib). I get something like the following errors:
Code: Text  [Select][+][-]
  1. (10028) Recompiling xyz, checksum changed for C:\freepascal\projects\Test\lib\i386-win32\LazProfilerRunTime.ppu
  2. C:\freepascal\projects\Test\formmain.pas(10,3) Fatal: (10022) Can't find unit xyz used by formmain
  3. Fatal: (1018) Compilation aborted
where unit xyz is part of a project-package and formmain is part of the project.

c) also does not work as there is no interface to add a package dependency to packages and the AddPackageDependency of TIDEProject does not work ('package xyz not found'. Although it works when done manually!).

Any ideas how to solve this?


laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

Pascal

  • Hero Member
  • *****
  • Posts: 932
Re: Extending IDE: Adding package to project and project-packages
« Reply #1 on: March 13, 2019, 12:27:28 pm »
One not so elegant solution, that works, is to temporary set the UnitOutputDirectory of project an project-packages to a common (temp-)directory and restore UnitOutputDirectory after building the (profiling-)executable.

Are there any better solutions?
laz trunk x64 - fpc trunk i386 (cross x64) - Windows 10 Pro x64 (21H2)

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Extending IDE: Adding package to project and project-packages
« Reply #2 on: March 13, 2019, 12:47:53 pm »
I suggest you contact Mattias directly.
He both designed (and AFAIK maintains) the Lazarus package system and its interfaces. His advice is likely to be more helpful than a hundred comments/guesses/suggestions from others.

 

TinyPortal © 2005-2018