linkexecutable

Description

(see the link page for more information about linking)
 
Link a normal executable with static libraries and object files. (configured using executablelinker)

Parameters

Attribute Description Required
output The name of the library. A platform specific ending and prefix might be added to this name automatically by the linker where appilcable (for example lib<name>.a<name>.dll, <name>.dylib <name>.lib) No. Default: "a.out"
debug true turns on debugging symbols. false optimizes for release. Exactly what is done is determined by the command sequence defined for this linker. No. Default: "true"
os
Override the detected OS to use another linker definition. This might be handy when using different compiler suites on the same machine and build script. No. Default:  detected OS name

Parameters specified as nested elements

libpath

An ant Path which tells the linker where to find the library files files specified with the lib-element.

staticlibrary

The static libraries to link into the target. This should be just the names without the path since they should be found either among the system library path or the path given by the libpath element. Also leave out the platform specific prefix and suffiixes (typically lib<name>.a or <name>.lib).  It can be accessed using an arglist with the name="staticlibraries".

dynamiclibrary

The dynamic libraries to link with the target. This should be just the names without the path since they should be found either among the system library path or the path given by the libpath element. Also leave out the platform specific prefix and suffiixes (typically lib<name>.dylib or <name>.lib).  It can be accessed using an arglist with the name="dynamiclibraries".

objfiles

An ant FileSet which selects all object files to link into the library file.. It can be accessed using an arglist with the name="objfiles".

Examples

<linkexecutable output="bin/test-linker}">
<objfiles dir="obj/test-linker" includes="**/*"/>
<libpath>
<pathelement path="build/lib"/>
</libpath>
<lib name="nc5"/>
</linkexecutable>
This will link all files in obj/test-linker together with the library nc5 and place the resulting file in bin/test-linker.exe or bin/test-linker