Swap CTN code gen and Libraries code gen, because SVGHMI use both, and need the library part to produce hmitree before CTN part. svghmi
authorEdouard Tisserant
Tue, 20 Aug 2019 10:08:11 +0200
branchsvghmi
changeset 2761 2684d643f60f
parent 2760 42a7ef43a0d8
child 2762 282500e03dbc
Swap CTN code gen and Libraries code gen, because SVGHMI use both, and need the library part to produce hmitree before CTN part.
ProjectController.py
--- a/ProjectController.py	Tue Aug 20 10:01:18 2019 +0200
+++ b/ProjectController.py	Tue Aug 20 10:08:11 2019 +0200
@@ -1163,6 +1163,19 @@
     def _Generate_runtime(self):
         buildpath = self._getBuildPath()
 
+        # CTN code gen is expected AFTER Libraries code gen,
+        # at least SVGHMI relies on it.
+
+        # Generate C code and compilation params from liraries
+        try:
+            LibCFilesAndCFLAGS, LibLDFLAGS, LibExtraFiles = self.GetLibrariesCCode(
+                buildpath)
+        except Exception:
+            self.logger.write_error(
+                _("Runtime library extensions C code generation failed !\n"))
+            self.logger.write_error(traceback.format_exc())
+            return False
+
         # Generate C code and compilation params from confnode hierarchy
         try:
             CTNLocationCFilesAndCFLAGS, CTNLDFLAGS, CTNExtraFiles = self._Generate_C(
@@ -1174,16 +1187,6 @@
             self.logger.write_error(traceback.format_exc())
             return False
 
-        # Generate C code and compilation params from liraries
-        try:
-            LibCFilesAndCFLAGS, LibLDFLAGS, LibExtraFiles = self.GetLibrariesCCode(
-                buildpath)
-        except Exception:
-            self.logger.write_error(
-                _("Runtime library extensions C code generation failed !\n"))
-            self.logger.write_error(traceback.format_exc())
-            return False
-
         self.LocationCFilesAndCFLAGS = LibCFilesAndCFLAGS + \
             CTNLocationCFilesAndCFLAGS
         self.LDFLAGS = CTNLDFLAGS + LibLDFLAGS