Handle upper-cased "Include" & "Src" folders

This commit is contained in:
Ivan Kravets
2021-10-08 14:58:41 +03:00
parent a1d55f2529
commit df83d90c06

View File

@ -184,19 +184,19 @@ class LibBuilderBase(object):
@property @property
def include_dir(self): def include_dir(self):
return ( for name in ("include", "Include"):
os.path.join(self.path, "include") d = os.path.join(self.path, name)
if os.path.isdir(os.path.join(self.path, "include")) if os.path.isdir(d):
else None return d
) return None
@property @property
def src_dir(self): def src_dir(self):
return ( for name in ("src", "Src"):
os.path.join(self.path, "src") d = os.path.join(self.path, name)
if os.path.isdir(os.path.join(self.path, "src")) if os.path.isdir(d):
else self.path return d
) return None
def get_include_dirs(self): def get_include_dirs(self):
items = [] items = []
@ -601,12 +601,6 @@ class MbedLibBuilder(LibBuilderBase):
return {} return {}
return ManifestParserFactory.new_from_file(manifest_path).as_dict() return ManifestParserFactory.new_from_file(manifest_path).as_dict()
@property
def include_dir(self):
if os.path.isdir(os.path.join(self.path, "include")):
return os.path.join(self.path, "include")
return None
@property @property
def src_dir(self): def src_dir(self):
if os.path.isdir(os.path.join(self.path, "source")): if os.path.isdir(os.path.join(self.path, "source")):