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/4760/head
Martin Kojtal 2017-07-12 12:59:00 +01:00 committed by adbridge
parent 3d0f789d86
commit e97380913c
1 changed files with 4 additions and 1 deletions

View File

@ -863,7 +863,10 @@ class mbedToolchain:
inc_paths = resources.inc_dirs inc_paths = resources.inc_dirs
if inc_dirs is not None: 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 # De-duplicate include paths
inc_paths = set(inc_paths) inc_paths = set(inc_paths)
# Sort include paths for consistency # Sort include paths for consistency