* * *

Author Topic: Out-of-Tree Builds With Lazarus?  (Read 625 times)

R0b0t1

  • Full Member
  • ***
  • Posts: 146
Out-of-Tree Builds With Lazarus?
« on: November 18, 2017, 02:53:28 am »
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,
     R0b0t1

Leledumbo

  • Hero Member
  • *****
  • Posts: 7743
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Out-of-Tree Builds With Lazarus?
« Reply #1 on: November 18, 2017, 06:12:24 pm »
No, since Lazarus itself requires its own source code to fully work.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5875
Re: Out-of-Tree Builds With Lazarus?
« Reply #2 on: November 18, 2017, 08:18:27 pm »
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. 
« Last Edit: November 18, 2017, 08:21:05 pm by marcov »

R0b0t1

  • Full Member
  • ***
  • Posts: 146
Re: Out-of-Tree Builds With Lazarus?
« Reply #3 on: November 22, 2017, 04:13:01 am »
While 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

  • Hero Member
  • *****
  • Posts: 7743
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Out-of-Tree Builds With Lazarus?
« Reply #4 on: November 22, 2017, 08:11:10 am »
I 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

  • Hero Member
  • *****
  • Posts: 4780
Re: Out-of-Tree Builds With Lazarus?
« Reply #5 on: November 22, 2017, 10:31:35 am »
While 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.
"Logically, no number of positive outcomes at the level of experimental testing can confirm a scientific theory, but a single counterexample is logically decisive."

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5875
Re: Out-of-Tree Builds With Lazarus?
« Reply #6 on: November 22, 2017, 11:07:14 am »
While 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.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus