mirror of https://github.com/ARMmbed/mbed-os.git
Rewrite include finction to only heed nearest library
parent
92475ae96c
commit
0265b57d35
|
|
@ -268,15 +268,19 @@ class Resources(object):
|
||||||
|
|
||||||
def _include_file(self, ref):
|
def _include_file(self, ref):
|
||||||
_, path = ref
|
_, path = ref
|
||||||
starts_with_included = any(
|
starts_with_excluded = [
|
||||||
path.startswith(dirname(e.path))
|
len(dirname(e.path)) for e in self._excluded_libs
|
||||||
for e in self._libs_filtered
|
if path.startswith(dirname(e.path))
|
||||||
)
|
]
|
||||||
starts_with_excluded = any(
|
if not starts_with_excluded:
|
||||||
path.startswith(dirname(e.path))
|
return True
|
||||||
for e in self._excluded_libs
|
starts_with_included = [
|
||||||
)
|
len(dirname(e.path)) for e in self._libs_filtered
|
||||||
return starts_with_included or not starts_with_excluded
|
if path.startswith(dirname(e.path))
|
||||||
|
]
|
||||||
|
if not starts_with_included:
|
||||||
|
return False
|
||||||
|
return max(starts_with_included) > max(starts_with_excluded)
|
||||||
|
|
||||||
def get_file_refs(self, file_type):
|
def get_file_refs(self, file_type):
|
||||||
"""Return a list of FileRef for every file of the given type"""
|
"""Return a list of FileRef for every file of the given type"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue