Page 1 of 1

Can I set Compiler Options for all Projects in a Workspace?

Posted: Thu Jul 30, 2020 12:34 am
by flexmcmurphy
I am writing C programs in Codelite.

To set compiler options (parameters) for an individual project I go to... Workspace > Open Active Project Settings > Compiler > C Compiler Options
Then I paste this in to the textbox --> -g;-O0;-Wall;-pedantic; -Wextra;-std=c99;

Is it possible to add those options somewhere so that ALL Projects in the same Workspace will have those compiler options?

Currently I have to set them again and again each time I create a new project.

Cheers,

Flex

Re: Can I set Compiler Options for all Projects in a Workspace?

Posted: Thu Jul 30, 2020 8:25 pm
by eranif
To apply compiler options across projects, use the environment variable CFLAGS (C) or CXXFLAGS (C++)
Just set them in the workspace settings or from settings -> environment variables

Eran

Re: Can I set Compiler Options for all Projects in a Workspace?

Posted: Fri Jul 31, 2020 1:30 am
by flexmcmurphy
Thanks Eran,

I went to Settings > Environment Variables > in here I added the line... CFLAGS=-g -O0 -Wall -pedantic -Wextra -std=c99

And yes it applies those compiler settings to all projects I have in that same workspace.

Cheers,

flex