Author Topic: Order of compile options in global project and target options  (Read 4042 times)

Offline pabristow

  • Multiple posting newcomer
  • *
  • Posts: 75
I understand that the order of compiler (and linker?) options (and thus which is the final option used "For options of the same specificity, the last one takes effect.") can be controlled by appending project or prepending or using only target or project.

and that there may also be global compiler settings.

Are any global compiler settings always last on the list and will therefore always override any project or target options?

Is this also true of  "Other compiler options"?

Thanks  Paul
 


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Order of compile options in global project and target options
« Reply #1 on: May 05, 2016, 03:53:46 pm »
The global compiler options are always first and it is rarely a good idea to put something there.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline freezy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Order of compile options in global project and target options
« Reply #2 on: February 24, 2022, 01:41:05 am »
I'm seeing the global compiler and linker "Other options" being placed at the end of the command-line here, which makes it impossible for a project to override them, I think? Is there a way to get the global options to be placed at the start of the command-line? That would allow common options to be set globally, and overridden for individual projects whenever needed.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Order of compile options in global project and target options
« Reply #3 on: February 24, 2022, 08:43:24 am »
Why would you want to override project options globally?

The hierarchy is global -> project -> target, with target the highest priority
the last two can be set up (ordered, excluded) in the project build options dialog. The global options can not be reordered.
You really should not use them for portability causes...

Offline freezy

  • Single posting newcomer
  • *
  • Posts: 6
Re: Order of compile options in global project and target options
« Reply #4 on: February 24, 2022, 01:52:49 pm »
The hierarchy is global -> project -> target, with target the highest priority

That is exactly what I want, but it isn't what I'm seeing here. I'm seeing this (lowest priority first):

   project -> target -> global

If that isn't normal, might it be related to the "Compiler Flags" pane not working? That stopped working here (it's empty) years ago and everything is under "Other compiler options" now, at both project and global level. I don't mind that, so never bothered to try to fix it.

I'm using CB 20.03.