struct Object.Attrs |
|
Optional attributes for an Object instance
XDCscript usage |
meta-domain |
var obj = new Object.Attrs;
obj.profile = String ...
// target options profile
obj.aopts = String ...
// asm options for this object
obj.copts = String ...
// C/C++ options for this object
obj.defs = String ...
// definitions for this object
obj.incs = String ...
// include options for this object
obj.preBuilt = Bool ...
// don't create a rule to generate this file
FIELDS
profile
This string names a profile defined by the
target used to produce the object file. The profile
specifies a set of compiler and assembler options that are
to be used when producing the object. Note that these tool
options are in addition to any options specified via aopts,
copts, etc.
incs
This string contains include path options used by
the compiler (or assembler) to locate include files; e.g.,
"-I ../../include -I ../c55xx". Note that the syntax of
this string may be target dependent.
defs
This string contains options used by the
compiler (or assembler) to define macros; e.g.,
"-D_C6xxx -DDEBUG=1". Note that the syntax of
this string may be target dependent.
aopts
This string contains options used by the assembler
to produce object files; e.g., "-mP1". Note that the syntax
of this string may be target dependent.
copts
This string contains options used by the C/C++
compiler to produce object files; e.g., "-o3 -mi1". Note
that the syntax of this string may be target dependent.
preBuilt
If equal to true, this Boolean flag indicates
that this object does not need to be built from sources; e.g.,
it has been pre-built and delivered as a binary file without
sources or some custom rule already built this object file.
For pre-built objects, no rule will be created to remove the
file as part of a package clean operation, the relative path
to the file must be fully specified, and all other Object
attributes are ignored.
DETAILS
Unspecified attributes are "inherited" from
xdc.bld.Executable.Attrs
(
xdc.bld.Library.Attrs) if this Object is added to an
xdc.bld.Executable (
xdc.bld.Library); i.e., if one
of fields in this structure is unspecified *and* this field's name
matches a field name in
xdc.bld.Executable.attrs,
then this field's value defaults to the value in specified by
xdc.bld.Executable.attrs. This mechanism makes it possible
to establish executable-wide default value for any of the "inherited"
attributes.
Suppose, for example, that you want all object files in this package
to be build with the '-o4' optimization flag, but one particular file
must be built with '-o2' (because the optimizer has a bug that it
causes it to fail on this file). The following build script fragment
shows how this can be accomplished:
var exe = Pkg.addExecutable(..., {copts: '-o4'});
exe.addObjects(['complex'], {copts: '-o2'});
exe.addObjects(['foo', 'bar', ...]);
Since many
Executable.attrs are "inherited" from
xdc.bld.PackageContents.attrs, it is also possible to
establish package-wide default for these attributes.
SEE
Instance Config Parameters |
|
XDCscript usage |
meta-domain |
var params = new Object.Params;
// Instance config-params object
// This instance's attributes
params.name = String undefined;
// The base name of the object file
config Object.attrs // instance |
|
This instance's attributes
XDCscript usage |
meta-domain |
var params = new Object.Params;
...
DETAILS
These attributes (unless otherwise specified) are "inherited" from
the container object that contains this instance.
SEE
config Object.name // instance |
|
The base name of the object file
XDCscript usage |
meta-domain |
var params = new Object.Params;
...
params.name = String undefined;
DETAILS
This name is passed as the name field of the
xdc.bld.ITarget.CompileGoal. The object file's name is
composed as follows:
where <name> is name and <target_suffix> is the suffix defined
by each target that the file is built for.