mirror of https://github.com/ARMmbed/mbed-os.git
Add get_file_paths res API and use it
parent
28dbbd6b3b
commit
a4cc32067d
|
@ -275,6 +275,9 @@ class Resources(object):
|
||||||
def get_file_names(self, file_type):
|
def get_file_names(self, file_type):
|
||||||
return [f.name for f in self.get_file_refs(file_type)]
|
return [f.name for f in self.get_file_refs(file_type)]
|
||||||
|
|
||||||
|
def get_file_paths(self, file_type):
|
||||||
|
return [f.path for f in self.get_file_refs(file_type)]
|
||||||
|
|
||||||
def add_files_to_type(self, file_type, files):
|
def add_files_to_type(self, file_type, files):
|
||||||
for f in files:
|
for f in files:
|
||||||
self.add_file_ref(file_type, f, f)
|
self.add_file_ref(file_type, f, f)
|
||||||
|
|
|
@ -374,8 +374,7 @@ class mbedToolchain:
|
||||||
|
|
||||||
self.notify.cc_verbose("Macros: "+' '.join(['-D%s' % s for s in self.get_symbols()]))
|
self.notify.cc_verbose("Macros: "+' '.join(['-D%s' % s for s in self.get_symbols()]))
|
||||||
|
|
||||||
inc_paths = [path for _, path
|
inc_paths = resources.get_file_paths(FileType.INC_DIR)
|
||||||
in resources.get_file_refs(FileType.INC_DIR)]
|
|
||||||
if inc_dirs is not None:
|
if inc_dirs is not None:
|
||||||
if isinstance(inc_dirs, list):
|
if isinstance(inc_dirs, list):
|
||||||
inc_paths.extend(inc_dirs)
|
inc_paths.extend(inc_dirs)
|
||||||
|
@ -628,14 +627,13 @@ class mbedToolchain:
|
||||||
bin = None if ext == 'elf' else full_path
|
bin = None if ext == 'elf' else full_path
|
||||||
map = join(tmp_path, name + '.map')
|
map = join(tmp_path, name + '.map')
|
||||||
|
|
||||||
objects = sorted(set([path for _, path
|
objects = sorted(set(r.get_file_paths(FileType.OBJECT)))
|
||||||
in r.get_file_refs(FileType.OBJECT)]))
|
|
||||||
config_file = ([self.config.app_config_location]
|
config_file = ([self.config.app_config_location]
|
||||||
if self.config.app_config_location else [])
|
if self.config.app_config_location else [])
|
||||||
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
|
linker_script = [path for _, path in r.get_file_refs(FileType.LD_SCRIPT)
|
||||||
if path.endswith(self.LINKER_EXT)][-1]
|
if path.endswith(self.LINKER_EXT)][-1]
|
||||||
lib_dirs = [path for _, path in r.get_file_refs(FileType.LIB_DIR)]
|
lib_dirs = r.get_file_paths(FileType.LIB_DIR)
|
||||||
libraries = [path for _, path in r.get_file_refs(FileType.LIB)]
|
libraries = r.get_file_paths(FileType.LIB)
|
||||||
dependencies = objects + libraries + [linker_script] + config_file
|
dependencies = objects + libraries + [linker_script] + config_file
|
||||||
dependencies.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-ld"))
|
dependencies.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-ld"))
|
||||||
if self.need_update(elf, dependencies):
|
if self.need_update(elf, dependencies):
|
||||||
|
|
Loading…
Reference in New Issue