Precompiled Headers

CodeLite installation/troubleshooting forum
ndivner
CodeLite Enthusiast
Posts: 37
Joined: Sun Mar 16, 2008 12:49 pm
Contact:

Precompiled Headers

Post by ndivner »

Hi,

I am using CodeLite 3.0.5041 on WinXP SP3 and Codesourcery Toolchain for ARM Cortex M3

I have added Codesourcery compilers to the Build Settings.

My projects are all ANSI C ie no C++ but when compiling the header file CodeLite insists on using the arm-none-eabi-g++ compiler
instead of the project selected compiler which is arm-none-eabi-gcc.

I would also like to be able to use the arm-none-eabi-g++ compiler to compile files with a .c extension but CodeLite will not
allow this and will call arm-none-eabi-gcc instead.

Best regards,

Noel Diviney.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Precompiled Headers

Post by eranif »

ndivner wrote:instead of the project selected compiler which is arm-none-eabi-gcc.
Can you please attach your build_settings.xml file? (located under %appdata%\CodeLite\config)

In general, codelite uses 2 main compiler macros in its generated makefiles:
$(CompilerName)
and
$(C_CompilerName)

The first macro is expanded to the value set in the "Settings | Build Settings | <Compiler Name> | Tools | C++ compiler name" and the later is expanded to the value
set in "Settings | Build Settings | Compilers | <Compiler Name> | Tools | C compiler name"

By default codelite uses $(CompilerName) for all .cpp/.c++/.cxx files and $(C_CompilerName) to .c files.
To change this you can modify the build command line pattern from:
"Settings | Build Settings | Compilers | <Compiler Name> | File Types"
Select the extension you want to modify (i.e. "c") and replace $(C_CompilerName) with $(CompilerName)

Eran
Make sure you have read the HOW TO POST thread
ndivner
CodeLite Enthusiast
Posts: 37
Joined: Sun Mar 16, 2008 12:49 pm
Contact:

Re: Precompiled Headers

Post by ndivner »

Hi Eran,

Thank you for the prompt response and taking the time to look at this for me.

I have attached PrecompiledHeaders.zip to provide details of whats happening.
In addition to the Project files I have also included the CodeLite Directory from C:\Documents & Settings.
Look in the zip for a subdirectory called "codelite".
The root directory of the zip file also has "BuildLog.txt" which is the output from a build run.
By default codelite uses $(CompilerName) for all .cpp/.c++/.cxx files and $(C_CompilerName) to .c files.
To change this you can modify the build command line pattern from:
"Settings | Build Settings | Compilers | <Compiler Name> | File Types"
Select the extension you want to modify (i.e. "c") and replace $(C_CompilerName) with $(CompilerName)
Thank you for the tip on overriding the default compiler selection.

Best regards,

Noel.
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Precompiled Headers

Post by eranif »

It looks like that codelite will always use the $(CompilerName) macro for the pre-compiled header
however, if your project is pure 'C' you can simply override the value set for this macro in the "Settings | Build Settings | Compilers | <compiler name> | Tools | C++ compiler name"

I will look into it (in any case, the fix will be part of the svn)
Eran
Make sure you have read the HOW TO POST thread
ndivner
CodeLite Enthusiast
Posts: 37
Joined: Sun Mar 16, 2008 12:49 pm
Contact:

Re: Precompiled Headers

Post by ndivner »

Thank you Eran.

I will do as you suggest.

I love the IDE. It is working very nicely with Openocd for embedded development.

Best regards,

Noel.
Post Reply