1

I work with many third party components. They have an installer that compiles the .pas and automatically adds the path to the library path.

The problem is that when I use the component in a project. The compiler is re-creating the .dcu of the third-party component. How can I make the compiler not create the .dcu again?

I found these old posts where they report similar problems. But I do not quite understand how I really say to compiler: "Compiler stops recreating the .dcu of third-party components, and get the .dcu from that place."

How to deal with warnings/hints in third party libraries?

How do I make third party component's DCU files, not to get generated in my application directory?

sartoz
  • 175
  • 1
  • 9
  • 8
    Move the third-party dcus to a separate directory below the source (in a DCU folder, for instance), and then change the library path to point there instead of to the source. – Ken White May 29 '19 at 20:24
  • @KenWhite but this affects all projects (including legacy). Is it possible to configure for a specific project? Doing this way also would not lose the part of debugging? – sartoz May 29 '19 at 20:33
  • 4
    For debugging, add the path to the source to the browsing path. And of course it affects all projects, because you don't want the third-party code recompiled every time it's used (which was the point of your question here, right?). – Ken White May 29 '19 at 20:35
  • Use Project->Options instead of Tools->Options and edit the search paths accordingly. – Freddie Bell May 30 '19 at 11:50
  • @FelipeGodinho It should be no problem for the legacy projects to use the .dcu too instead of the .pas files. – R. Hoek May 31 '19 at 19:26
  • @FelipeGodinho Regarding debugging: create .dcu files with and without debugging information. When configuring the IDE just supply the correct library paths for release and debug (these are seperately configurable). And dont forget to add the .pas path to the browsing directory. Now when selecting the debug config for the project in the IDE and selecting ‘use debug dcus’ this will allow you to debug into the third party components. – R. Hoek May 31 '19 at 19:32

1 Answers1

1

First: remove the location of the .pas files from the ‘library path’ (IDE setting) and replace it with the location of the .dcu path (note: the dcu files must be in a different folder then the .pas files of the library, or else the .pas files will be build anyway). Be sure your project itself also does not reference the .pas files using it’s own search path.

Second: when you want to inspect the code of the third party component using ctrl-mouseclick, add the .pas path to the browsing path of your IDE.

Regarding debugging: you might want to build two sets of dcu’s; one with debugging info and one without...

R. Hoek
  • 916
  • 8
  • 27