Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: pabristow on May 05, 2016, 03:39:29 pm

Title: Order of compile options in global project and target options
Post by: pabristow on May 05, 2016, 03:39:29 pm
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
 

Title: Re: Order of compile options in global project and target options
Post by: oBFusCATed 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.
Title: Re: Order of compile options in global project and target options
Post by: freezy 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.
Title: Re: Order of compile options in global project and target options
Post by: BlueHazzard 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...
Title: Re: Order of compile options in global project and target options
Post by: freezy 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.