tools: fix toolchain extend inc paths

inc paths might be a list or might not be (just single string). If they don't, we are ending up with non valid include paths (one letter include paths).
This as result would not compile.
pull/4749/head
Martin Kojtal 2017-07-12 12:59:00 +01:00
parent aae62bd990
commit 441fda979d
1 changed files with 4 additions and 1 deletions

View File

@ -863,7 +863,10 @@ class mbedToolchain:
inc_paths = resources.inc_dirs
if inc_dirs is not None:
inc_paths.extend(inc_dirs)
if isinstance(inc_dirs, list):
inc_paths.extend(inc_dirs)
else:
inc_paths.append(inc_dirs)
# De-duplicate include paths
inc_paths = set(inc_paths)
# Sort include paths for consistency