1
votes

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?

1
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
@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?Felipe Godinho
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
Use Project->Options instead of Tools->Options and edit the search paths accordingly.Freddie Bell
@FelipeGodinho It should be no problem for the legacy projects to use the .dcu too instead of the .pas files.R. Hoek

1 Answers

1
votes

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...