CMSIS-Build  
Tools, software frameworks, and work flows for productivity with CMSIS based projects
 All Pages
/cprj/files

The files section specifies files to be included into the project build that are not managed through software components. Files can be associated with a named group. Grouping is mainly for better visualization in a graphical tool, however commandline flags can also be applied on a group level.

Example files section:

<cprj xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd"/>
...
<components>
...
</components>
<files>
<group name="Source Files">
<file category="sourceC" name="./Blinky.c"/>
<file category="sourceC" name="./Thread_LED.c"/>
</group>
<group name="Documentation">
<file category="doc" name="./Abstract.txt"/>
</group>
</files>
</cprj>


Parents Element Chain
cprj /cprj
Child Elements Description Type Occurrence
file Specify a file. FileType 0..*
group Specify a group name and list member files in subelements. GroupType 0..*
cflags Specify compiler flags for C-modules contained in this group. ToolOptionType 0..1
cxxflags Specify compiler flags for C++-modules contained in this group. ToolOptionType 0..1
asflags Specify assembler flags for Assembler-modules contained in this group. ToolOptionType 0..1
includes Specify a semicolon separated list of include paths that are valid for the compilation of the modules in this group. xs:string optional
excludes Specify a semicolon separated list of include paths to be removed from the compilation of the modules in this group. xs:string optional
defines Specify a semicolon separated list of preprocessor defines that are valid for modules undergoing preprocessing in this group. Key/value pairs are separated by the equal sign. xs:string optional
undefines Specify a semicolon separated list of preprocessor undefines that are valid for modules undergoing preprocessing in this group. xs:string optional

 


/cprj/files/.../group

The description format allows the nesting of groups. It is up to the tool's implementation how grouping is represented in the user interface. The grouping of files only impacts the build, if the assignment of command line options on a group level is supported. The group's name must be unique, multiple groups at the same level with the same name are not allowed.

Example files section:

<cprj xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="CPRJ.xsd"/>
...
<files>
<group name="Source">
<group name="C">
<cflags add="-D_MY_DEFINE"/>
<file category="sourceC" name="./Blinky.c"/>
<file category="sourceC" name="./Thread_LED.c"/>
</group>
<group name="ASM">
<file category="sourceAsm" name="./startup_add.s"/>
</group>
</group>
<group name="Documentation">
<file category="doc" name="./Abstract.txt"/>
</group>
</files>
</cprj>


Parents Element Chain
files /cprj/files
Attributes Description Type Use
name Unique name of the group of files RestrictedString required
Child Elements Description Type Occurrence
file Specify a file. FileType 0..*
group Specify a group (nesting). GroupType 0..*

 


/cprj/files/group/.../cflags

These compiler options are either added or removed from the inherited command line and affect all C-modules that belong to the file group. This flag can also be added to components and individual files within the description.

See: /cprj/components/component/cflags

 


/cprj/files/group/.../cxxflags

These compiler options are either added or removed from the inherited command line and affect all C++-modules that belong to the file group. This flag can also be added to components and individual files within the description.

See: /cprj/components/component/cxxflags

 


/cprj/files/group/.../asflags

These assembler options are either added or removed from the inherited command line and affect all Assembler modules that belong to the file group. This flag can also be added to components and individual files within the description.

See: /cprj/components/component/asflags

 


/cprj/files/.../file

Specify files that are not included through software components.

Parents Element Chain
files /cprj/files
group /cprj/files/.../group
Attributes Description Type Use
name Path and name of the file, relative to location of the project file. xs:string required
category Type of file, for example, whether the file is a C or assembler file. Use the predefined values from the table File Categories. FileCategoryType required
src Folder specifying the source code location for a library if included in a subdirectory. xs:string optional
cflags Specify compiler flags this file. ToolOptionType 0..1
cxxflags Specify compiler flags this file. ToolOptionType 0..1
asflags Specify assembler flags for this file. ToolOptionType 0..1
includes Specify a semicolon separated list of include paths that are valid for the compilation of this file. xs:string optional
excludes Specify a semicolon separated list of include paths to be removed from the compilation of this file. xs:string optional
defines Specify a semicolon separated list of preprocessor defines that are valid for this file. Key/value pairs are separated by the equal sign. xs:string optional
undefines Specify a semicolon separated list of preprocessor undefines that are valid for this file. xs:string optional

 


/cprj/files/.../file/cflags

These compiler options are either added or removed from the inherited command line and affect the C-modules that is referenced by the file. This flag can also be added to components and file groups within the description. Note: if the file category attribute is anything but 'sourceC' or 'source' and the file's extension is *.c, the element will be ignored.

See: /cprj/components/component/cflags

 


/cprj/files/.../file/cxxflags

These compiler options are either added or removed from the inherited command line and affect the C++-modules that is referenced by the file. This flag can also be added to components and file groups within the description. Note: if the file category attribute is anything but 'sourceCpp' or 'source' and the file extension is *.cpp, the flag will be ignored.

See: /cprj/components/component/cxxflags

 


/cprj/files/.../file/asflags

These assembler options are either added or removed from the inherited command line and affect the Assembler module that is referenced by the file. This flag can also be added to components and file groups within the description. Note: if the file category attribute is anything but 'sourceAsm' or 'source' and the file extension is *.s, the flag will be ignored.

See: /cprj/components/component/asflags