From 0a3df9a9e08e763227131fcd580f4c59fb65c06f Mon Sep 17 00:00:00 2001 From: Willie Walker Date: Wed, 12 Apr 2017 16:34:30 -0400 Subject: [PATCH] Skip imports of mbed-os in libraries imported by apps --- mbed/mbed.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mbed/mbed.py b/mbed/mbed.py index 8354a44e..d86b997f 100644 --- a/mbed/mbed.py +++ b/mbed/mbed.py @@ -1116,6 +1116,12 @@ def getlibs(self): for f in files: if f.endswith('.lib') or f.endswith('.bld'): + # If a library imports mbed-os and we're in including that + # library in our app, skip the import of mbed-os: the app + # will have already imported mbed-os. + if f == 'mbed-os.lib' and self.pathtype() == 'library': + action("Skipping redundant import of mbed-os in \"%s\"" % self.path) + continue repo = Repo.fromlib(os.path.join(root, f)) if repo: yield repo