Procházet zdrojové kódy

[tools][gcc.py] avoid dist failure when try to dist MDK/IAR project.

Because for MKD/IAR project, in the rtconfig.py, there is no rtconfig.PREFIX defined.
Meco Man před 1 rokem
rodič
revize
dc407966fa
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12 0
      tools/gcc.py

+ 12 - 0
tools/gcc.py

@@ -72,6 +72,12 @@ def GetGCCLikePLATFORM():
 
 def GetNewLibVersion(rtconfig):
     version = None
+
+    try:
+        rtconfig.PREFIX
+    except:
+        return version
+
     root = GetGCCRoot(rtconfig)
     if CheckHeader(rtconfig, '_newlib_version.h'): # get version from _newlib_version.h file
         f = open(os.path.join(root, 'include', '_newlib_version.h'), 'r')
@@ -92,6 +98,12 @@ def GetNewLibVersion(rtconfig):
 # FIXME: there is no musl version or musl macros can be found officially
 def GetMuslVersion(rtconfig):
     version = None
+
+    try:
+        rtconfig.PREFIX
+    except:
+        return version
+
     if 'musl' in rtconfig.PREFIX:
         version = 'unknown'
     return version