Recent

Author Topic: Compiler directive when in the IDE?  (Read 2569 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compiler directive when in the IDE?
« Reply #15 on: July 14, 2020, 10:07:32 am »
in the drop down and add "bin/$(TargetCPU)-$(TargetOS)/Debug/projectName" to the "Target file name" field. This way whenever you are building

Is the mode name available as a $(something) for use in this context?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Compiler directive when in the IDE?
« Reply #16 on: July 14, 2020, 10:28:37 am »
There actually is $(BuildMode)

Funny, I'm doing this hardcoding now for years and never bothered to check if there is such a switch.

That said, if you have multiple Release and Debug Buildmodes (for different architectures) I like the arch-os/Debug and arch-os/Release structure more (compared to for example bin/ReleaseX86_64Linux or bin/Debugi386Windows or so) and as this is a one-time effort, I am probably sticking with my current system (as I nearly always build for Windows and Linux)

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Compiler directive when in the IDE?
« Reply #17 on: July 14, 2020, 10:47:38 am »
There actually is $(BuildMode)

Don't act so surprised- I was asking, not challenging :-)

OK, it's set to "Default" if no explicit modes are set up so something like

SomeApp-$(TargetCPU)-$(TargetOS)-$(LCLWidgetType)-$(BuildMode)

will never be left with a trailing dash. This is something that I really ought to get into the habit of using, although I habitually leave as much range checking etc. in programs as possible.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Warfley

  • Hero Member
  • *****
  • Posts: 1499
Re: Compiler directive when in the IDE?
« Reply #18 on: July 14, 2020, 02:01:34 pm »
Don't act so surprised- I was asking, not challenging :-)
I actually was suprised, I've been using build modes for nearly every project for the past 4 years now and never even thought about the existence of such a switch

This is something that I really ought to get into the habit of using, although I habitually leave as much range checking etc. in programs as possible.

MarkMLl
Yeah, this makes everything easier, for your gitignore you now only need to add the bin directory, especially when cross compiling you basically can iterate over the subdirectories in /bin to pack your releases.
But it can also be annoying at times because, when you add a new Unit in a new folder, you get asked if you want to add this unit, and if you say yes, it is only added to the currently selected build mode. This then results in, when building release mode, suddenly nothing can be found because you created the buildmodes at the very beginning and only added things to the debug mode.

But it's a great feature which doesn't get talked about enough in beginners guides and stuff. It took me years to find out that a. it existed and b. how useful it is

 

TinyPortal © 2005-2018