Skip to content

Commit 6e7e3b2

Browse files
committed
Change how static libraries with .lib extension are handled and produce warning instead of error (#113)
1 parent 1ad46ed commit 6e7e3b2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mbed/mbed.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -815,9 +815,10 @@ def fromlib(cls, lib=None):
815815
with open(lib) as f:
816816
ref = f.read(200)
817817
if ref.startswith('!<arch>'):
818-
error(
819-
"A Keil uVision static library \"%s\" in \"%s\" uses a non-standard .lib file extension (should be .ar), which is not compatible with the mbed build tools.\n"
820-
"Please rename the static library to \"%s\" and try again.\n" % (os.path.basename(lib), os.path.split(lib)[0], os.path.basename(lib).replace('.lib', '.ar')))
818+
warning(
819+
"A static library \"%s\" in \"%s\" uses a non-standard .lib file extension, which is not compatible with the mbed build tools.\n"
820+
"Please change the extension of \"%s\" (for example to \"%s\").\n" % (os.path.basename(lib), os.path.split(lib)[0], os.path.basename(lib), os.path.basename(lib).replace('.lib', '.ar')))
821+
return False
821822
else:
822823
return cls.fromurl(ref, lib[:-4])
823824

@@ -969,7 +970,9 @@ def getlibs(self):
969970

970971
for f in files:
971972
if f.endswith('.lib') or f.endswith('.bld'):
972-
yield Repo.fromlib(os.path.join(root, f))
973+
repo = Repo.fromlib(os.path.join(root, f))
974+
if repo:
975+
yield repo
973976
if f[:-4] in dirs:
974977
dirs.remove(f[:-4])
975978

0 commit comments

Comments
 (0)