Fixed loading projects with no libraries at all
authorEdouard Tisserant
Thu, 14 Jun 2012 15:50:57 +0200
changeset 770 131110501214
parent 769 502939f9c477
child 772 98786137232d
Fixed loading projects with no libraries at all
ProjectController.py
--- a/ProjectController.py	Thu Jun 14 14:42:00 2012 +0200
+++ b/ProjectController.py	Thu Jun 14 15:50:57 2012 +0200
@@ -61,15 +61,15 @@
                 """+targets.GetTargetChoices()+"""
                 </xsd:choice>
               </xsd:complexType>
-            </xsd:element>"""+(("""
-            <xsd:element name="Libraries" minOccurs="0">
+            </xsd:element>
+            <xsd:element name="Libraries" minOccurs="0">"""+(("""
               <xsd:complexType>
               """+"\n".join(['<xsd:attribute name='+
                              '"Enable_'+ libname + '_Library" '+
                              'type="xsd:boolean" use="optional" default="true"/>' 
                              for libname,lib in features.libraries])+"""
-              </xsd:complexType>
-            </xsd:element>""") if len(features.libraries)>0 else '') + """
+              </xsd:complexType>""") if len(features.libraries)>0 else '<xsd:complexType/>') + """
+            </xsd:element>
           </xsd:sequence>
           <xsd:attribute name="URI_location" type="xsd:string" use="optional" default=""/>
           <xsd:attribute name="Disable_Extensions" type="xsd:boolean" use="optional" default="false"/>
@@ -371,6 +371,8 @@
         return "\n".join([ lib.GetSTCode() for lib in self.Libraries ])
 
     def GetLibrariesCCode(self, buildpath):
+        if len(self.Libraries)==0:
+            return [],[],()
         self.GetIECProgramsAndVariables()
         LibIECCflags = '"-I%s"'%os.path.abspath(self.GetIECLibPath())
         LocatedCCodeAndFlags=[]