Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] CDT's handling of compilation switches

 
Corey.

I've been working lately on a modification to allow command switches to
be edited in the 'All Options' field, parsed and the relevant settings
reflected into the preference store.  As a result I came up with the
following model for synonyms to commands (where you have the
<equivalents> element.

<option ... command="-o" ... >
	<synonym commandPrefix="-o" commandSynonym="-o" />
</option>

The 'prefix' is necessary to disambiguate where there exist synonyms for
multiple different commands all within the aegis of one option for
example the 'command' and boolean 'falseCommand' fields in boolean
valuetype options or where there exist multiple enumerated options (not
of the form -O1, -O2 etc. but where the commands are still orthogonal to
one another).  To cater for synonyms of the argument in options of the
form --option=argument or -O1 where the argument may take many values
that conform to one logical value (often the 'default' matches the empty
string as well as an explicit string) I posit:
As an example from ARM's tools (with attributes not relevant to this
discussion removed)

<option name="CONFIG_CPU" category="Target" id="CONFIG_CPU"
browseType="none" command="--cpu=" valueType="enumerated">
.
.
.
	 <enumeratedOptionValue name="CONFIG_CPU.ARM7TDMI"
id="CONFIG_CPU.ARM7TDMI" command="" isDefault="true">
	 	<valueSynonym synonymValue="--cpu=ARM7TDMI"/>
       </enumeratedOptionValue>
.
.
.
	<synonym commandSynonym="--proc=" commandPrefix="--cpu="/>
      <synonym commandSynonym="--arch=" commandPrefix="--cpu="/>
</option>

Thus options --proc=ARM7TDMI and --cpu=ARMTTDMI represent one logical
command as well as the empty string.  Obviously multiple valueSynonyms
could exist.  This construct enables a greater degree of flexibility,
without having to enumerate every single option=argument pair that might
exist, indicating which option it maps to.  Of course, whatever output
the gcc tool gives can be translated with an XSLT or something into a
format the CDT can understand.

Chris Mead.
Software Engineer.
ARM Ltd.
Cambridge.



--
The 2006 ARM Developers' Conference, October 3-5, Santa Clara, US 
Join ARM and its technology and tools Partners from around the world at the only industry event for developers of ARM Powered(R) solutions. 
http://www.arm.com/developersconference/


IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.




Back to the top