mirror of https://github.com/ARMmbed/mbed-os.git
Merge branch 'root-include-path' of ssh://github.com/theotherjimmy/mbed into rollup
commit
14a9824511
|
@ -261,26 +261,26 @@ class Resources(object):
|
||||||
return list(self._file_refs[file_type])
|
return list(self._file_refs[file_type])
|
||||||
|
|
||||||
def _all_parents(self, files):
|
def _all_parents(self, files):
|
||||||
for name in files:
|
for name, path in files:
|
||||||
components = name.split(self._sep)
|
components = name.split(self._sep)
|
||||||
start_at = 2 if components[0] in set(['', '.']) else 1
|
start_at = 0
|
||||||
for index, directory in reversed(list(enumerate(components))[start_at:]):
|
for index, directory in reversed(list(enumerate(components))):
|
||||||
if directory in self._prefixed_labels:
|
if directory in self._prefixed_labels:
|
||||||
start_at = index + 1
|
start_at = index + 1
|
||||||
break
|
break
|
||||||
|
prefix = path.replace(name, "")
|
||||||
for n in range(start_at, len(components)):
|
for n in range(start_at, len(components)):
|
||||||
parent = self._sep.join(components[:n])
|
parent_name = self._sep.join(components[:n])
|
||||||
yield parent
|
parent_path = join(prefix, *components[:n])
|
||||||
|
yield FileRef(parent_name, parent_path)
|
||||||
|
|
||||||
def _get_from_refs(self, file_type, key):
|
def _get_from_refs(self, file_type, key):
|
||||||
if file_type is FileType.INC_DIR:
|
if file_type is FileType.INC_DIR:
|
||||||
parents = set(self._all_parents(self._get_from_refs(
|
parents = set(self._all_parents(self._file_refs[FileType.HEADER]))
|
||||||
FileType.HEADER, key)))
|
|
||||||
parents.add(".")
|
|
||||||
else:
|
else:
|
||||||
parents = set()
|
parents = set()
|
||||||
return sorted(
|
return sorted(
|
||||||
list(parents) + [key(f) for f in self.get_file_refs(file_type)]
|
[key(f) for f in list(parents) + self.get_file_refs(file_type)]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -188,7 +188,7 @@ class ARM(mbedToolchain):
|
||||||
if self.RESPONSE_FILES:
|
if self.RESPONSE_FILES:
|
||||||
opts += ['--via', self.get_inc_file(includes)]
|
opts += ['--via', self.get_inc_file(includes)]
|
||||||
else:
|
else:
|
||||||
opts += ["-I%s" % i for i in includes]
|
opts += ["-I%s" % i for i in includes if i]
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ class ARMC6(ARM_STD):
|
||||||
|
|
||||||
def get_compile_options(self, defines, includes, for_asm=False):
|
def get_compile_options(self, defines, includes, for_asm=False):
|
||||||
opts = ['-D%s' % d for d in defines]
|
opts = ['-D%s' % d for d in defines]
|
||||||
opts.extend(["-I%s" % i for i in includes])
|
opts.extend(["-I%s" % i for i in includes if i])
|
||||||
if for_asm:
|
if for_asm:
|
||||||
return ["--cpreproc",
|
return ["--cpreproc",
|
||||||
"--cpreproc_opts=%s" % ",".join(self.flags['common'] + opts)]
|
"--cpreproc_opts=%s" % ",".join(self.flags['common'] + opts)]
|
||||||
|
|
Loading…
Reference in New Issue