Recent

Author Topic: Use different packages per build mode?  (Read 1852 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1980
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Use different packages per build mode?
« Reply #15 on: March 05, 2025, 12:48:14 am »
Unfortunately project dependencies cannot be configured depending on the platform, build mode, and the like... This is really missing. For now, you can only use different project files in different situations, but this is inconvenient((

Thaddy claims they can. Let's wait for his answer.  ::)
Of course they can be configured by simply adapting fpc.cfg.
That is even documented - in the skeleton fpc.cfg..... But you can also do that and use that from Lazarus, which ultimately relies on.... You guessed it... fpc.cfg.
Pretending otherwise is a fallacy.
If such seasoned programmers like you two even overlooked that and got stuck in Lazarus only environment that is a sorry thing to watch.


You said that a Lazarus package can be included or excluded in Lazarus project build modes. But you didn't say how and apparently no one but you knows how it can be done.
Would you please finally tell us? It would be additionally appreciated if you could explain it without unnecessary talk about compiler defines and config files, which have nothing to do with Lazarus project build modes.
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

TRon

  • Hero Member
  • *****
  • Posts: 4377
Re: Use different packages per build mode?
« Reply #16 on: March 05, 2025, 01:00:56 am »
It would be additionally appreciated if you could explain it without unnecessary talk about compiler defines and config files, which have nothing to do with Lazarus project build modes.
It ain't unnecessary talk as ultimately it is how the compiler (note: compiler, not Lazarus) works.

If you leave out the whole Lazarus build-system (or whatever it is named that is responsible for including packages in a Lazarus project and setting the search-paths for the compiler) then how would one compile a project (any project, including Lazarus projects) ?

Without getting yourself into too much mess, compiler defines and a correct (extensive) config file is what it take to accomplish that. Dunno if lazbuild is able to adapt to such a detailed approach but that could perhaps be an option (I haven't given that much attention as I was more interested in how to compile lazarus projects with fpc).

btw I would not recommend doing all of this for production work but it is a nice exercise.

PS: In case still in doubt -va is the answer
« Last Edit: March 05, 2025, 01:13:28 am by TRon »
Today is tomorrow's yesterday.

zamtmn

  • Hero Member
  • *****
  • Posts: 679
Re: Use different packages per build mode?
« Reply #17 on: March 05, 2025, 08:24:17 am »
no, because it is the responsability of the programmer to provide debug and release packages. si.
I given an example where this is not only impossible, but also unnecessary.

 

TinyPortal © 2005-2018