Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Managing additional toolchain state

Treggiari, Leo wrote:
Hi,

It's not clear to me what you are trying to do, but I'll give you some
thoughts and maybe they'll help.

It's very straightforward: The OPTLINK linker requires a special file, a module definition file. This module definition file contains, among other things, the Win32 subsystem that the executable requires (console, posix, winapi, etc), the Win32 code and data segment attributes (shared, readonly, etc.)

The module definition is sensitive enough that (a) it really needs a form to manage its contents so that only the "correct" values end up in the file, (b) it'd be nice to save the file's state along with the project. (b) is relatively more important since I'm not looking forward to writing a file parser when an XML parser already exists and is heavily used.

The managed build system allows you to define tools (e.g. compiler,
linker) and their command line options.  I don't know what you mean by
"I created a properties page for this module def file".  Do you have a
tool that creates module definition files, or does your user use a text
editor to create the file?  If there is a tool, then you can define the
tool in your tool-chain definition.  If the file is simply a text file
that is input to the linker, you can define your own linker tool that
has an additional option for specifying the name of the module
definition file.  That option can generate whatever command line option
is needed by the linker (e.g. /def:filename).

You're preaching to the choir. I have, in fact, created a property page to modify and tweak some of the file's settings, i.e.:

   <!-- OPTLINK Properties Page -->
   <extension
         point="org.eclipse.ui.propertyPages">
      <page
            adaptable="true"
            objectClass="org.eclipse.core.resources.IProject"
            class="org.eclipse.cdt.dmc.ui.OptlinkPropertyPage"
            name="%DMCOptlinkPropertyPage.name"
            id="org.eclipse.cdt.dmc.optlinkProperties">
         <filter
               name="nature"

value="org.eclipse.cdt.managedbuilder.core.managedBuildNature">
         </filter>
      </page>
   </extension>

I've also written the Makefile generator as well (not that hard, really, as the GNU makefile generator offers a decent template to work from.)

What I'm missing is how to connect the state I've collected in the OPTLINK properties page back to ManagedBuildInfo, or some extended version of it, so that the page's values can get serialized out to .cdtproject or .cdtbuild. Clearer now?


Back to the top