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

General questions regarding the usage of CodeLite
flexmcmurphy
CodeLite Curious
Posts: 7
Joined: Sun Jul 26, 2020 12:01 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
Make sure you have read the HOW TO POST thread
flexmcmurphy
CodeLite Curious
Posts: 7
Joined: Sun Jul 26, 2020 12:01 am
Genuine User: Yes
IDE Question: C++
Contact:

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

Post 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
Post Reply