Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Language Settings Providers and toolchain prefixes

Hi Andrew,

Thanks again for your help.


On 19/10/12 04:39, Andrew Gvozdev wrote:
Hi Matt,

On Thu, Oct 18, 2012 at 2:46 AM, Matt Jervis <matt.jervis@xxxxxxxxxxxxx> wrote:
 * Should ${COMMAND} include the prefix? if not, is there a variable I can use to get the prefix (e.g., ${PREFIX}${COMMAND})?
The intention was to use/reuse variables from managedbuilder plugin. For some reason, it does not define ${PREFIX} variable. I think we should be consistent here. I did not work much with cross compilers but perhaps ${PREFIX} should be added to both places?
Yes, I think that it would make sense for there to be a ${PREFIX} variable to get the prefix from the toolchain, and it would also make sense for the default command to get compiler specs parameter to use ${PREFIX}${COMMAND} rather than just ${COMMAND} since ${PREFIX} would simply be empty if there was no prefix defined.
I would suggest to create a bugzilla with an enhancement request to keep track of this idea.
I have created a new bug (#392404) on bugzilla to track this as you suggested.
 
 * If I do need to change the 'Command to get compiler specs' is it possible to do this programmatically?
Yes, it should be possible. Take a look at JavaDoc for ILanguageSettingsProvider, AbstractBuiltinSpecsDetector and ToolchainBuiltinSpecsDetector. Let me know if you have difficulties with that.
I have achieved what I wanted by declaring a new language settings provider in my plugin.xml; this provider uses the GCCBuiltinSpecsDetector class and has a customised parameter attribute (just the default value with the toolchain prefix prepended).  I then have a custom project type in which I define configurations that have this provider and the User Settings Provider as their language settings providers.  The only issue I have is that the check boxes next to the language settings providers in the Providers tab of project properties stay unticked until I close and reopen the project; this is not really a problem for me since I just have the project generation code close and reopen the project before it finishes.
As far as checkboxes, it sounds that there is something wrong, do you use a custom New Project Wizard by any chance?
The wizard I have basically coded from scratch, following this series of tutorials: http://cvalcarcel.wordpress.com/2009/07/11/writing-an-eclipse-plug-in-part-2-creating-a-custom-project-in-eclipse-adding-to-the-new-project-wizard/

However, perhaps I should be using the New Project Wizard as a base? I will look into that next week.  A further note that may be of interest is that the include paths don't show up under the project folder in Project Explorer until I first view the "Preprocessor Include Paths, Macros etc." project properties page (I don't have to change anything there, just open and close it).

You should use MBS provider but disable legacy scanner discovery. Not sure why you are picking it. As far as I remember it should be disabled by default unless you define scannerConfigDiscoveryProfileId explicitly for toolchain or input type via buildDefinitions extension point. Maybe you are using existing CDT input type where they are defined or added programmatically for legacy support.
I'm not quite sure what I was doing wrong, but I have now reworked my projectType and configuration extensions so that they do not subclass any of the existing extensions and that seems to have resolved this issue.

Thanks,
Matt


Back to the top