Out-of-Tree Builds With Lazarus? lazarus / 11-Options ---------------------------------------------------------------------- guest60499 · 2017-11-18 01:53 Hello, When using autotools it is possible to run ./configure in a directory that is not the top level project directory so as to not pollute a large source tree (e.g. the Linux kernel) with object files, and to maintain one source tree for all configurations. Is this possible with Lazarus? I have tried to do some investigation, but all builds seem to happen in-tree. Cheers,      guest ---------------------------------------------------------------------- Leledumbo · 2017-11-18 17:12 No, since Lazarus itself requires its own source code to fully work. ---------------------------------------------------------------------- marcov · 2017-11-18 19:18 While true, that doesn't mean binaries and source need to be mixed. I think out of tree builds would be a good thing for both FPC and lazarus long term, but it is not easy to change the existing complex systems. I think one of the problems is that C invokes the compiler for every file, so passes a destination dir for each file, allowing the makefiles to build a hierarchy by doing something like  $CC  ../src/dir/from  -odir/from for every file. While FPC compiles heaps of units in one run, you can set only one output dir, and all files end up there. ---------------------------------------------------------------------- guest60499 · 2017-11-22 03:13 Quote from: marcov on November 18, 2017, 08:18:27 pmWhile FPC compiles heaps of units in one run, you can set only one output dir, and all files end up there. That will be enough - I apologize, because it looks like I missed an existing setting. This Wiki section seems to describe what I want. The exact behavior is irrelevant as long as FPC (or the IDE) can resolve dependencies. I asked as I don't want to pollute a fairly large source tree with files I don't mean to track with Git. ---------------------------------------------------------------------- Leledumbo · 2017-11-22 07:11 Quote from: guest on November 22, 2017, 04:13:01 amI asked as I don't want to pollute a fairly large source tree with files I don't mean to track with Git. If this is your original intention, then just .gitignore *.o and *.ppu, perhaps *.rst and *.res as well. ---------------------------------------------------------------------- Thaddy · 2017-11-22 09:31 Quote from: marcov on November 18, 2017, 08:18:27 pmWhile true, that doesn't mean binaries and source need to be mixed. It was actually you that instructed me to do an export.... Which I still think is sound advice for such a case. ---------------------------------------------------------------------- marcov · 2017-11-22 10:07 Quote from: Thaddy on November 22, 2017, 10:31:35 amQuote from: marcov on November 18, 2017, 08:18:27 pmWhile true, that doesn't mean binaries and source need to be mixed. It was actually you that instructed me to do an export.... Which I still think is sound advice for such a case. That is a workaround (e.g. for snapshot building that happens at night) But it is slow(ing) for repeated builds while you are waiting for it, specially if you have an HDD, there is a case you made changes in the wrong tree etc. I'd like a Configure like scheme.  But probably that would mean passing a "root" src dir to the compiler, so that the compiler can calculate the relative path, and then append that relative path with -FE. But the number of complications (symlinks, auto-compiling files outside the tree) make the process complex.