Override make/gcc/g++ from workspace

General questions regarding the usage of CodeLite
screetch
CodeLite Curious
Posts: 6
Joined: Wed Sep 03, 2008 11:44 am
Contact:

Override make/gcc/g++ from workspace

Post by screetch »

Hello,

I wonder if it is possible to override the GCC/G++ compiler used from the workspace environment variable or better, from the project settings (which depend on the current configuration)
I would like to have a workspace that contains projects with the configurations :
x86 debug
x86 release
amd64 debug
amd64 release
and x86 and amd64 have different compilers.

it is almost possible, by setting the following env variables :

Code: Select all

DebugLinkerName g++.exe
LinkerName $($(ConfigurationName)LinkerName)

but the problem is that the definition is overriden in the makefile :

Code: Select all

##
## Auto Generated makefile, please do not edit
##
DebugLinkerName:=g++-1
LinkerName:=$($(ConfigurationName)Linkername)
ProjectName:=test

## Debug
ifeq ($(type),Debug)
ConfigurationName :=Debug
IntermediateDirectory :=./Debug
OutDir := $(IntermediateDirectory)
LinkerName:=g++
...
Any idea ?

I think that the easiest would be to add a setting for it in the project, like this :

Code: Select all

      <Compiler Required="yes" Options="-g" Path="toolchains/x86/bin/g++.exe">
        <IncludePath Value="."/>
      </Compiler>
Also, the make command is "special" for me, I wonder if there could be a setting for it also ?
I can dig in the code if necessary :)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Override make/gcc/g++ from workspace

Post by eranif »

screetch wrote:I wonder if it is possible to override the GCC/G++ compiler used from the workspace environment variable or better, from the project settings (which depend on the current configuration)
I would like to have a workspace that contains projects with the configurations :
Why dont u define a new compiler?

From 'Settings -> Build Settings...'

Click on 'New..' button (give it a name 'my new modified gnu g++')
once You click OK, you define the toolchain from the 'Tools' tab of the newly created compiler.

Once you have setup a compiler, you can set it to be used by a specific configuration
So assuming your project name is:
'Prj' with configurations:
x86 debug -> set compiler: gnu g++
x86 release ->set compiler: gnu g++
amd64 debug -> set compiler: my new modified gnu g++
amd64 release -> set compiler: my new modified gnu g++

HTH,
Eran
Make sure you have read the HOW TO POST thread
screetch
CodeLite Curious
Posts: 6
Joined: Wed Sep 03, 2008 11:44 am
Contact:

Re: Override make/gcc/g++ from workspace

Post by screetch »

That's almost what I need. The project files are generated from a build script and I wonder if it is possible to include the new compilers in either the project or the workspace so that people don't need to modify their environment to use the project :)
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Override make/gcc/g++ from workspace

Post by eranif »

screetch wrote:That's almost what I need. The project files are generated from a build script and I wonder if it is possible to include the new compilers in either the project or the workspace so that people don't need to modify their environment to use the project :)
You can always share your 'build_settings.xml' with others (C:\Program Files\CodeLite\config)

Eran
Make sure you have read the HOW TO POST thread
Post Reply