Recent

Author Topic: Additions and Overrides: default Target dir; custom option for a platform  (Read 4252 times)

Jungle

  • New Member
  • *
  • Posts: 25
1. I want to set default* Target file name to
Code: Pascal  [Select][+][-]
  1. bin\$(TargetCPU)-$(TargetOS)\$(BuildMode)\$NameOnly($(ProjFile))
I've tried setting IDE Macro ProjOutDir, but it doesn't work.

2. I want to set -X9 custom option only for linux platform by default*.

I've tried setting Custom for target linux in Compiler Options > Additions and Overrides, but it doesn't work.

How can it be done?

*Default == for every new and existing project, it's inconvenient to change these settings manually for every project.

P.S. Lazarus 2.0.12

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Does the "Set compiler options as default" checkbox help?

I prefer the same sort of thing, but haven't got round to investigating the checkbox. Also in my case I prefer to also have the widgetset name in there, which might be problematic for console-mode programs.

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

Jungle

  • New Member
  • *
  • Posts: 25
Does the "Set compiler options as default" checkbox help?
No

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
"Options > Additions and Overrides, "

The "Target" is the name of any package (LCL, TaChart, ...) or #project  (there is a wiki page that has more details.


While I have not done that myself, if you look at the page "Custom Options" you will see in the "conditionals" sections
Code: [Select]
// example for adding linker options on Mac OS X
//if TargetOS='darwin' then
//  LinkerOptions := ' -framework OpenGL';

https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Custom_Options


There is a checkbox at the bottom of the form, that saves current settings as new default.

Jungle

  • New Member
  • *
  • Posts: 25
if you look at the page "Custom Options" you will see in the "conditionals" sections
Code: [Select]
// example for adding linker options on Mac OS X
//if TargetOS='darwin' then
//  LinkerOptions := ' -framework OpenGL';

https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Custom_Options


There is a checkbox at the bottom of the form, that saves current settings as new default.

When I set -X9 in Custom options, it works. When I write

Code: [Select]
if TargetOS='Linux' then
  LinkerOptions := ' -X9';

in Conditionals, it doesn't work

"Set compiler options as default" works for new projects, but doesn't work for existing ones.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Code: [Select]
if TargetOS='Linux' then
  LinkerOptions := ' -X9';

in Conditionals, it doesn't work

I suspect it's case-sensitive, try 'linux'.

Quote
"Set compiler options as default" works for new projects, but doesn't work for existing ones.

Reasonable I suppose.

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

Jungle

  • New Member
  • *
  • Posts: 25
I suspect it's case-sensitive, try 'linux'.

Already tried, also tried "i386-linux". As well as "LinkerOptions += ' -X9'";

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
It's definitely not i386-linux, but there's references to 'linux' in this context in various places in Lazarus source.

If that doesn't work my suspicion is that it's something to do with the way you're framing the conditional... hopefully Martin will drop in again presently.

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

 

TinyPortal © 2005-2018