Lazarus

Using the Lazarus IDE => Options => Topic started by: Jungle on April 07, 2021, 08:30:26 am

Title: Additions and Overrides: default Target dir; custom option for a platform
Post by: Jungle on April 07, 2021, 08:30:26 am
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
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: MarkMLl on April 07, 2021, 09:18:41 am
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
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: Jungle on April 07, 2021, 09:41:42 am
Does the "Set compiler options as default" checkbox help?
No
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: Martin_fr on April 08, 2021, 05:01:40 pm
"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.
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: Jungle on April 09, 2021, 08:13:19 am
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.
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: MarkMLl on April 09, 2021, 09:04:17 am
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
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: Jungle on April 09, 2021, 09:16:00 am
I suspect it's case-sensitive, try 'linux'.

Already tried, also tried "i386-linux". As well as "LinkerOptions += ' -X9'";
Title: Re: Additions and Overrides: default Target dir; custom option for a platform
Post by: MarkMLl on April 09, 2021, 09:35:18 am
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
TinyPortal © 2005-2018