Fix wrong default target being picked in CLI build
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Sat, 20 May 2023 00:36:41 +0200
changeset 3810 eafb8f000584
parent 3809 45accb98d761
child 3811 fcd2826f5c9e
Fix wrong default target being picked in CLI build
ProjectController.py
--- a/ProjectController.py	Sat May 20 00:35:41 2023 +0200
+++ b/ProjectController.py	Sat May 20 00:36:41 2023 +0200
@@ -27,7 +27,7 @@
 Beremiz Project Controller
 """
 
-
+import sys
 import os
 import traceback
 import time
@@ -368,12 +368,16 @@
         return "PROJECT"
 
     def GetDefaultTargetName(self):
-        if wx.Platform == '__WXMSW__':
+        if sys.platform.startswith('linux'):
+            return "Linux"
+        elif sys.platform.startswith('darwin'):
+            return "OSX"
+        elif sys.platform.startswith('win32'):
             return "Win32"
-        elif wx.Platform == '__WXMAC__':
-            return "OSX"
-        else:
-            return "Linux"
+        
+        # Fall back to Linux as default target
+        return "Linux"
+        
 
     def GetTarget(self):
         target = self.BeremizRoot.getTargetType()