Kaynağa Gözat

[CMSIS-Build] Extend CPRJ schema and documentation with target includes and defines fields

Daniel Brondani 4 yıl önce
ebeveyn
işleme
e2a77bb70f
2 değiştirilmiş dosya ile 83 ekleme ve 18 silme
  1. 77 4
      CMSIS/DoxyGen/Build/src/cprj_schema.txt
  2. 6 14
      CMSIS/Utilities/CPRJ.xsd

+ 77 - 4
CMSIS/DoxyGen/Build/src/cprj_schema.txt

@@ -438,12 +438,14 @@ The high level structure of a project is constructed from:
 This element describes the hardware target, build output and command line options for a specific compiler tool-chain.
 These settings are applied to all modules of the project. The C/C++ and assembler flags can be refined for components, files.
 The following elements are available:
-- \ref element_output "output"     : Build output options
+- \ref element_output "output"            : Build output options
+- \ref element_includes "includes"        : List of include paths
+- \ref element_defines "defines"          : List of preprocessor definitions
 - \ref element_target_cflags "cflags"     : C compiler options applied to C modules (category="sourceC").
 - \ref element_target_cxxflags "cxxflags" : C++ compiler options applied to C++ modules (category="sourceCpp").
 - \ref element_target_asflags "asflags"   : Assembler options applied to Assembler modules (category="sourceAsm").
-- \ref element_ldflags "ldflags"   : Linker options applied when output attribute type="exe".
-- \ref element_arflags "arflags"   : Archiver options applied to Librarian when output attribute type="lib".
+- \ref element_ldflags "ldflags"          : Linker options applied when output attribute type="exe".
+- \ref element_arflags "arflags"          : Archiver options applied to Librarian when output attribute type="lib".
 
 Note: The compiler referenced by the above command line flags is required to be listed in the \<compilers> section.
 
@@ -458,6 +460,8 @@ Note: The compiler referenced by the above command line flags is required to be
   ...
   <target Dname="ARMCM0" Dvendor="ARM:82" Dendian="Little-endian">
     <output name="Blinky" type="exe" outdir="./Objects intdir="./Listings"/>
+    <includes>./path/to/header/files</includes>
+    <defines>DEF1=1;DEF2=2</defines>
     <cflags compiler="AC5" add="-Osize"/>
     ...
     <ldflags compiler="AC5" file="./RTE/Device/ARMCM0/gcc_arm.ld"/>
@@ -566,18 +570,30 @@ Note: The compiler referenced by the above command line flags is required to be
     <td>OutputType</td>
     <td>1..1</td>
   </tr>
+  <tr>
+    <td>\ref element_includes "includes"</td>
+    <td>List of include paths</td>
+    <td>xs:string</td>
+    <td>0..1</td>
+  </tr>
+  <tr>
+    <td>\ref element_defines "defines"</td>
+    <td>List of preprocessor definitions</td>
+    <td>xs:string</td>
+    <td>0..1</td>
+  </tr>
   <tr>
     <td>\ref element_ldflags "ldflags"</td>
     <td>Linker flags used for constructing the effective linker command line</td>
     <td>LinkerFlagsType</td>
     <td>0..1</td>
+  </tr>
   <tr>
     <td>\ref element_arflags "arflags"</td>
     <td>Archiver command line flags for the toolchain selected by 'compiler' attribute.</td>
     <td>ArchiverFlagsType</td>
     <td>0..1</td>
   </tr>
-  </tr>
   <tr>
     <td>\ref type_toolOptionType "cflags"</td>
     <td>Compiler flags for C-modules used for constructing the effective compiler command line</td>
@@ -667,6 +683,63 @@ Specify the build output directories, output file and type (executable vs. libra
 
 \delim
 
+\section element_includes /cprj/target/includes
+This element specifies a semicolon separated list of include paths that are valid for the compilation of all modules in the project.
+
+\b Example <em>includes</em> element
+\code
+<cprj ...>
+  ...
+  <target Ddsp="NO_DSP" Dendian="Little-endian" Dfpu="NO_FPU" Dmve="NO_MVE" Dname="LPC4357" Dtz="NO_TZ" Dvendor="NXP:11" Pname="Cortex-M4">
+    <output intdir="./Debug/" name="BSD_Client" outdir="./Debug/" type="exe"/>
+    <includes>./path/to/header/files</includes>
+  </target>
+  ...
+</cprj>
+\endcode
+
+<table class="cmtable" summary="Element: includes">
+  <tr>
+    <th>Parents</th>
+    <th colspan="3">Element Chain</th>
+  </tr>
+  <tr>
+    <td>\ref element_target "target"</td>
+    <td colspan="3">\ref element_target</td>
+  </tr>
+</table>
+
+\delim
+
+\section element_defines /cprj/target/defines
+This element specifies a semicolon separated list of preprocessor definitions that are valid for all project modules undergoing preprocessing.
+Key/value pairs are separated by the equal sign.
+
+\b Example <em>defines</em> element
+\code
+<cprj ...>
+  ...
+  <target Ddsp="NO_DSP" Dendian="Little-endian" Dfpu="NO_FPU" Dmve="NO_MVE" Dname="LPC4357" Dtz="NO_TZ" Dvendor="NXP:11" Pname="Cortex-M4">
+    <output intdir="./Debug/" name="BSD_Client" outdir="./Debug/" type="exe"/>
+    <defines>DEF1=1;DEF2=2</defines>
+  </target>
+  ...
+</cprj>
+\endcode
+
+<table class="cmtable" summary="Element: defines">
+  <tr>
+    <th>Parents</th>
+    <th colspan="3">Element Chain</th>
+  </tr>
+  <tr>
+    <td>\ref element_target "target"</td>
+    <td colspan="3">\ref element_target</td>
+  </tr>
+</table>
+
+\delim
+
 \section element_ldflags /cprj/target/ldflags
 This element specifies strings of commandline options for the linker of the tool-chain selected by the attribute 'compiler'. 
 A linker script file shall be specified using the attribute 'file'. Note that this option only takes effect if the type specified

+ 6 - 14
CMSIS/Utilities/CPRJ.xsd

@@ -184,18 +184,6 @@
     </xs:restriction>
   </xs:simpleType>
 
-  <xs:complexType name="ComponentCategoryType">
-    <xs:attribute name="Cvendor"     type="xs:string"            use="optional" />
-    <xs:attribute name="Cbundle"     type="xs:string"            use="optional" />
-    <xs:attribute name="Cclass"      type="xs:string"            use="required" />
-    <xs:attribute name="Cgroup"      type="xs:string"            use="optional" />
-    <xs:attribute name="Csub"        type="xs:string"            use="optional" />
-    <xs:attribute name="Cvariant"    type="xs:string"            use="optional" />
-    <xs:attribute name="Cversion"    type="ComponentVersionType" use="optional" />
-    <xs:attribute name="Capiversion" type="ComponentVersionType" use="optional" />
-    <xs:attribute name="instances"   type="InstancesType"        use="optional" default="1" />
-  </xs:complexType>
-
   <!-- PackageType creates a unique ID for a package / if no version specified use "latest" -->
   <xs:complexType name="PackageType">
     <!-- vendor of the package -->
@@ -274,9 +262,9 @@
   <!-- Project target specification: -->
   <xs:complexType name="TargetType">
     <xs:choice maxOccurs="unbounded">
-      <!-- build options -->
+      <!-- Build options -->
       <xs:element name="output"    type="OutputType" />
-      <!-- linker command-line -->
+      <!-- Linker command-line -->
       <xs:element name="ldflags"   type="LinkerFlagsType" />
       <!-- C-Compiler command-line -->
       <xs:element name="cflags"    type="ToolOptionType" />
@@ -286,6 +274,10 @@
       <xs:element name="arflags"  type="ToolOptionType" />
       <!-- Assembler command-line -->
       <xs:element name="asflags"   type="AsmOptionType" />
+      <!-- Include paths -->
+      <xs:element name="includes"  type="xs:string" minOccurs="0" />
+      <!-- Preprocessing definitions -->
+      <xs:element name="defines"   type="xs:string" minOccurs="0" />
     </xs:choice>
     <!-- Board Vendor -->
     <xs:attribute name="Bvendor"  type="xs:string"   use="optional" />