Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Setting compilation options to g++


sindolfo wrote:
> I'm a beginner with the CDT API and need to pass a -D flag to g++ in my
> CDT Project. Is there a way to set the compilation parameters of a CDT
> project using the CDT API?

I'm a beginner with the CDT API too and was searching for a possibility to pass options to a compile as well.
I made a very simple project template for our purposes. Until now it's just xml-definitions - no line of java.
So I'm wondering, if it's not possible to do the options definition in xml without programming.
The two solutions to sindolfo's question from fstanley and Marc Weber include a minimum of programming, when I understood well.
Recently I found a tutorial "Extending the Eclipse CDT Managed Build System" for toolchain-definition at There it's described how you can call a tool giving command line options using the org.eclipse.cdt.managedbuilder.core.buildDefintions extension point.
I tried it and found it not too easy, but it worked at the end. I did'nt try to use this in our template until now.

So my question to the savants: is this a feasable and good way to change command line options or would it be easyer/better to
overwrite methods?

Back to the top