compiler

Description

Defines a command sequence which will compile files on a specific platform. This sequence will be called by a compile task. It is perfectly OK to be very platform specific in those tasks as they are only run when the os-attribute matches the current platform.

Parameters

Attribute Description Required
os
The operating system for which the task is to be used.
No. Default:  detected OS name
showcommandline Setting this attribute to "true" will display each command line before it's executed.
No. Default: "false".

Parameters specified as nested elements

command

The command to run. In fact any number of commands may be executed in sequence by specifying multiple command-elements.

Examples

<compiler os="Windows XP">
<command file="cl">
<arg value="/c"/>
<arglist name="srcfiles"/>
<arglist name="includepath" prefix="/I"/>
</command>
</compiler>


<compiler os="mac os x">
<command file="g++-4.0">
<arg value="-c"/>
<arglist name="srcfiles"/>
<arglist name="includepath" prefix="-I "/>
</command>
</compiler>

The above example defines two compilers, the first one will be used when running the compiler task on a Windows XP, the second one only on Mac OS X platforms.

Below is a more likely example illustrating some of the complexities that can be handled with the command-element.

<compiler os="Windows XP">
<command file="cl">
<arg value="/nologo"/>
<arg value="/EHsc"/>
<arg value="/D_WIN32_WINNT=0x0501"/>
<arg value="/D_CRT_SECURE_NO_DEPRECATE=1"/>
<arg value="/c"/>
<arg value="/Zi"/>
<arg value="/Od"/>
<arg value="/RTC1"/>
<arg value="/MDd"/>
<switch attribute="debug">
<case value="true">
<arg value="/D_DEBUG"/>
</case>
<case value="false">
<arg></arg>
</case>
</switch>
<arglist name="srcfiles"/>
<arglist name="includepath" prefix="/I"/>
<arglist name="defines" prefix="/D"/>
</command>
</compiler>


<compiler os="mac os x">
<command file="g++-4.0">
<arg value="-arch i686"/>
<arg value="-c"/>
<switch attribute="debug">
<case value="true">
<arg value="-g"/>
</case>
<case value="false">
<arg value="-Os"/>
</case>
</switch>
<arglist name="srcfiles"/>
<arglist name="includepath" prefix="-I "/>
</command>
</compiler>