mirror of https://github.com/ARMmbed/mbed-os.git
Filter libraries by extension in exporters
parent
62538e3bce
commit
3b7a5bb35e
|
@ -59,7 +59,7 @@ class AtmelStudio(Exporter):
|
|||
source_folders.append(e)
|
||||
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ class CCES(Exporter):
|
|||
cxx_flags = self.flags['cxx_flags'] + self.flags['common_flags']
|
||||
|
||||
libs = []
|
||||
for libpath in self.resources.libraries:
|
||||
for libpath in self.libraries:
|
||||
lib = os.path.splitext(os.path.basename(libpath))[0]
|
||||
libs.append(lib[3:]) # skip 'lib' prefix
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class CMake(Exporter):
|
|||
srcs = [re.sub(r'^[.]/', '', f) for f in srcs]
|
||||
|
||||
# additional libraries
|
||||
libraries = [self.prepare_lib(basename(lib)) for lib in self.resources.libraries]
|
||||
libraries = [self.prepare_lib(basename(lib)) for lib in self.libraries]
|
||||
sys_libs = [self.prepare_sys_lib(lib) for lib in self.toolchain.sys_libs]
|
||||
|
||||
# sort includes reverse, so the deepest dir comes first (ensures short includes)
|
||||
|
|
|
@ -143,7 +143,7 @@ class CMSIS(Exporter):
|
|||
def generate(self):
|
||||
srcs = self.resources.headers + self.resources.s_sources + \
|
||||
self.resources.c_sources + self.resources.cpp_sources + \
|
||||
self.resources.objects + self.resources.libraries + \
|
||||
self.resources.objects + self.libraries + \
|
||||
[self.resources.linker_script]
|
||||
srcs = [fileCMSIS(src, src) for src in srcs if src]
|
||||
ctx = {
|
||||
|
|
|
@ -90,8 +90,7 @@ class CodeBlocks(GccArm):
|
|||
not x.startswith('obj'))];
|
||||
|
||||
c_sources = sorted([self.filter_dot(s) for s in self.resources.c_sources])
|
||||
libraries = [self.prepare_lib(basename(lib)) for lib
|
||||
in self.resources.libraries]
|
||||
libraries = [self.prepare_lib(basename(lib)) for lib in self.libraries]
|
||||
sys_libs = [self.prepare_sys_lib(lib) for lib
|
||||
in self.toolchain.sys_libs]
|
||||
ncs36510fib = (hasattr(self.toolchain.target, 'post_binary_hook') and
|
||||
|
|
|
@ -88,7 +88,7 @@ class CoIDE(Exporter):
|
|||
})
|
||||
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ class DS5_5(Exporter):
|
|||
'name': self.project_name,
|
||||
'include_paths': self.resources.inc_dirs,
|
||||
'scatter_file': self.resources.linker_script,
|
||||
'object_files': self.resources.objects + self.resources.libraries,
|
||||
'object_files': self.resources.objects + self.libraries,
|
||||
'source_files': source_files,
|
||||
'symbols': self.toolchain.get_symbols()
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class EmBitz(Exporter):
|
|||
})
|
||||
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
|
|
|
@ -118,6 +118,11 @@ class Exporter(object):
|
|||
config_header.name)
|
||||
return flags
|
||||
|
||||
@property
|
||||
def libraries(self):
|
||||
return [l for l in self.resources.get_file_names(FileType.LIB)
|
||||
if l.endswith(self.toolchain.LIBRARY_EXT)]
|
||||
|
||||
def toolchain_flags(self, toolchain):
|
||||
"""Returns a dictionary of toolchain flags.
|
||||
Keys of the dictionary are:
|
||||
|
|
|
@ -90,7 +90,7 @@ class GNUARMEclipse(Exporter):
|
|||
# TODO: use some logger to display additional info if verbose
|
||||
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ class IAR(Exporter):
|
|||
raise NotSupportedException("No linker script found.")
|
||||
srcs = self.resources.headers + self.resources.s_sources + \
|
||||
self.resources.c_sources + self.resources.cpp_sources + \
|
||||
self.resources.objects + self.resources.libraries
|
||||
self.resources.objects + self.libraries
|
||||
flags = self.flags
|
||||
c_flags = list(set(flags['common_flags']
|
||||
+ flags['c_flags']
|
||||
|
|
|
@ -33,7 +33,7 @@ class KDS(Exporter):
|
|||
|
||||
def generate(self):
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class LPCXpresso(Exporter):
|
|||
|
||||
def generate(self):
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
libraries.append(l[3:])
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ class Makefile(Exporter):
|
|||
self.resources.cpp_sources]
|
||||
|
||||
libraries = [self.prepare_lib(basename(lib)) for lib
|
||||
in self.resources.libraries]
|
||||
in self.libraries]
|
||||
sys_libs = [self.prepare_sys_lib(lib) for lib
|
||||
in self.toolchain.sys_libs]
|
||||
|
||||
|
|
|
@ -76,12 +76,13 @@ class MCUXpresso(GNUARMEclipse):
|
|||
|
||||
# TODO: use some logger to display additional info if verbose
|
||||
|
||||
self.libraries = []
|
||||
libraries = []
|
||||
# print 'libraries'
|
||||
# print self.resources.libraries
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
self.libraries.append(l[3:])
|
||||
libraries.append(l[3:])
|
||||
self.libraries = libraries
|
||||
|
||||
self.system_libraries = [
|
||||
'stdc++', 'supc++', 'm', 'c', 'gcc', 'nosys'
|
||||
|
|
|
@ -144,7 +144,7 @@ class SimplicityV3(Exporter):
|
|||
main_files.append(source)
|
||||
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
l, _ = splitext(basename(lib))
|
||||
if l[3:] not in EXCLUDED_LIBS:
|
||||
libraries.append(l[3:])
|
||||
|
|
|
@ -434,7 +434,7 @@ class Sw4STM32(GNUARMEclipse):
|
|||
self.resources.win_to_unix()
|
||||
|
||||
libraries = []
|
||||
for lib in self.resources.libraries:
|
||||
for lib in self.libraries:
|
||||
library, _ = splitext(basename(lib))
|
||||
libraries.append(library[3:])
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ class Uvision(Exporter):
|
|||
|
||||
srcs = self.resources.headers + self.resources.s_sources + \
|
||||
self.resources.c_sources + self.resources.cpp_sources + \
|
||||
self.resources.objects + self.resources.libraries
|
||||
self.resources.objects + self.libraries
|
||||
ctx = {
|
||||
'name': self.project_name,
|
||||
# project_files => dict of generators - file group to generator of
|
||||
|
|
Loading…
Reference in New Issue