Swap CTN code gen and Libraries code generation order. In general library part of an extension needs to be computed before CTN part.
authorEdouard Tisserant
Tue, 20 Aug 2019 10:08:11 +0200
changeset 2631 b5402859dfad
parent 2630 4d5c5e5871ab
child 2632 534387caf43d
Swap CTN code gen and Libraries code generation order. In general library part of an extension needs to be computed 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