Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Help integrating toolchain - sharing tool options in MBS

I’ve been working with CDT for a long time now, but this is the first time I’ve ever had to integrate a new toolchain.  There are some options that are shared between the compiler and linker in this toolchain.  Rather than showing the setting in the UI for each tool, I created a category containing these options under the toolchain itself.  So far so good.  Now I need to read the options from the toolchain and have each tool generate the proper command line for it (the syntax is slightly different between the tools).

 

I could create my own IManagedCommandLineGenerator for each tool, but that seems like overkill.  The default implementation is fine, and it’s internal so I’d rather not extend it for this.

 

I’ve tried two other approaches but have problems either way.  I feel like I must be missing something simple.  I’ve searched and seen a couple others with similar problems but no clear resolution.  Hopefully someone on the list can help.

 

The first approach was to create a ‘hidden’ option in each tool to mirror the shared options.  Then I specify my own IOptionCommandGenerator for those ‘hidden’ options.  Inside generateCommand I’d read the value of the shared option and return the appropriate command.  The problem there is I only have the IOption.  From there I can get back to the parent toolchain, but the values are not set, so when I do a getValue I just get back the default values.  There are actually two toolchain instances.  The one that has the modified values from the UI (with the random number appended to the end), and the one from the extension.  I can only seem to get the latter from the IOption, so I can’t get the current values.

 

The second approach was to specify my own IManagedOptionValueHandler for the shared options.  When they change (APPLY in handleValue) I’d get the options in the tools and set them to the current shared value.  That works fine as the IHoldsOptions passed in is the toolchain with the modified values.  The problem there is that you get an APPLY event as soon as you change anything in the UI.  You get another when they click OK.  So they change the shared value, I set the values in the tools to match, then they click cancel instead of OK.  The changed toolchain value is somehow thrown away, but the tool values that I set are persisted.  So the next time they open the build settings (or do a build) they’ll get the wrong command line for the tools.

 

Anyway, I hope someone can provide some suggestions.

 

Thanks,

Warren

This message (including any attachments) is intended only for the use of the individual or entity to which it is addressed and may contain information that is non-public, proprietary, privileged, confidential, and exempt from disclosure under applicable law or may constitute as attorney work product.  If you are not the intended recipient, you are hereby notified that any use, dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, notify us immediately by telephone and (i) destroy this message if a facsimile or (ii) delete this message immediately if this is an electronic communication.  

Thank you.


Back to the top