Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Problems with Tool Option enablement

Thanks a lot for your reply Oleg.

I managed to do something similar by removing the hidden option from the
tools altogether and overriding the commandLineGenerator of the tool to
add the appropriate flag.  However I've noticed that even though the
linker and compiler command have changed, on build the object is only
relinked and not rebuilt (which gives an error) so I have to do a build
clean explicitly. Admittedly it isn't expected that users will change
this setting terribly frequently...

Will have a go using the applicabilityCalculator, thanks again for the
tip!

James 

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Krasilnikov, Oleg
Sent: 27 February 2008 16:59
To: CDT General developers list.
Subject: RE: [cdt-dev] Problems with Tool Option enablement

Hi James.

I cannot advise something regarding enablement,
but may be the following workaround may help you:

1. Define applicabilityCalculator for your option.
	<option
	        id="..."
                    ...  
	
applicabilityCalculator="org.eclipse.cdt.managedbuilder.core.IOptionAppl
icability.Implementor"
             >
See "org.eclipse.cdt.managedbuilder.core.IOptionApplicability"
interface.

Its implementation is usually trivial, but you can use the method 
"isOptionUsedInCommandLine()" to change option value (on a basis of the
toolchain value or something else) just before using it in compiler
command.
This method is always called while Tool.getToolCommandFlags() runs.

NB: this works for CDT 4.0.3 or the latest code only. Not for 4.0.2.
-----------------------------------
With best regards, Oleg Krasilnikov

 

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of James Blackburn
Sent: Monday, February 25, 2008 4:08 PM
To: CDT General developers list.
Subject: [cdt-dev] Problems with Tool Option enablement

Hi All,

I'm having some problems automatically setting the value of a tool's
option based on that of a toolchain option value.  I'm attempting to do
this by subclassing the toolchain option in each of the tools that need
it, and by using the enablement element to update 'value'. 

Unfortunately it seems to work intermittently.  I've attempted to trace
through the code and seen that control flow reaches
ManagedBuildManager.setOption(...) with my updated enum values, for the
given subclassed tool.  However this often doesn't translate to a change
in the compiler command.

Attached is what I'm doing in the plugin.xml.

In the toolchain, I've got this:

      <toolChain id="toolchain"
          ...
         <optionCategory
               icon="icons/broadcom.gif"
               id="toolchain.processor"
               name="Our Processor">
         </optionCategory>
         <option
               category="toolchain.processor"
               id="toolchain.processor.id"
               name="Machine"
               valueType="enumerated">
            <enumeratedOptionValue
                  command="-m1"
                  id="toolchain.processor.id.1"
                  name="Machine 1">
            </enumeratedOptionValue>
            <enumeratedOptionValue
                  command="-m2"
                  id="toolchain.processor.id.2"
                  name="Machine 2">
            </enumeratedOptionValue>
         </option>
         ...

And in the compiler / linker tool I have this :

         <option
               id="compiler.machine"
               superClass="toolchain.processor.id">
            <enablement
                  type="UI_VISIBILITY">
               <false>
                  false body text
               </false>
            </enablement>
            <enablement
                  attribute="value"
                  type="CONTAINER_ATTRIBUTE"
                  value="toolchain.processor.id.1">
               <checkOption
                     holderId="toolchain"
                     optionId="toolchain.processor.id"
                     value="toolchain.processor.id.1">
               </checkOption>
            </enablement>
            <enablement
                  attribute="value"
                  type="CONTAINER_ATTRIBUTE"
                  value="toolchain.processor.id.2">
               <checkOption
                     holderId="toolchain"
                     optionId="toolchain.processor.id"
                     value="toolchain.processor.id.2">
               </checkOption>
            </enablement>
         </option>

If anyone has any experience doing this, am I doing something obviously
wrong?

Many thanks in advance,

James

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

--------------------------------------------------------------------
Closed Joint Stock Company Intel A/O
Registered legal address: Krylatsky Hills Business Park, 
17 Krylatskaya Str., Bldg 4, Moscow 121614, 
Russia Federation

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev




Back to the top