mirror of https://github.com/ARMmbed/mbed-os.git
exporter: properly export libraries
parent
84fe7ed5fd
commit
7b7d5fcb91
|
@ -51,6 +51,16 @@ class CodeBlocks(GccArm):
|
||||||
return str_in[2:]
|
return str_in[2:]
|
||||||
return str_in
|
return str_in
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def prepare_lib(libname):
|
||||||
|
if "lib" == libname[:3]:
|
||||||
|
libname = libname[3:-2]
|
||||||
|
return "-l" + libname
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def prepare_sys_lib(libname):
|
||||||
|
return "-l" + libname
|
||||||
|
|
||||||
def generate(self):
|
def generate(self):
|
||||||
self.resources.win_to_unix()
|
self.resources.win_to_unix()
|
||||||
|
|
||||||
|
@ -79,6 +89,10 @@ class CodeBlocks(GccArm):
|
||||||
not x.startswith('obj'))];
|
not x.startswith('obj'))];
|
||||||
|
|
||||||
c_sources = sorted([self.filter_dot(s) for s in self.resources.c_sources])
|
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]
|
||||||
|
sys_libs = [self.prepare_sys_lib(lib) for lib
|
||||||
|
in self.toolchain.sys_libs]
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
'project_name': self.project_name,
|
'project_name': self.project_name,
|
||||||
|
@ -91,7 +105,8 @@ class CodeBlocks(GccArm):
|
||||||
'cpp_sources': sorted([self.filter_dot(s) for s in self.resources.cpp_sources]),
|
'cpp_sources': sorted([self.filter_dot(s) for s in self.resources.cpp_sources]),
|
||||||
'include_paths': inc_dirs,
|
'include_paths': inc_dirs,
|
||||||
'linker_script': self.filter_dot(self.resources.linker_script),
|
'linker_script': self.filter_dot(self.resources.linker_script),
|
||||||
'libraries': self.resources.libraries,
|
'libraries': libraries,
|
||||||
|
'sys_libs': sys_libs,
|
||||||
'openocdboard': ''
|
'openocdboard': ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,12 @@
|
||||||
<Add option="{{f}}" />
|
<Add option="{{f}}" />
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
<Add option="-T {{linker_script}}" />
|
<Add option="-T {{linker_script}}" />
|
||||||
|
<Add option="-Wl,--start-group {{sys_libs|join(" ")}} {{libraries|join(" ")}} -Wl,--end-group" />
|
||||||
|
{% for f in sys_libs -%}
|
||||||
|
<Add option="{{f}}" />
|
||||||
|
{% endfor -%}
|
||||||
{% for f in libraries -%}
|
{% for f in libraries -%}
|
||||||
<Add library="{{f}}" />
|
<Add option="{{f}}" />
|
||||||
{% endfor -%}
|
{% endfor -%}
|
||||||
</Linker>
|
</Linker>
|
||||||
{% for f in headers -%}
|
{% for f in headers -%}
|
||||||
|
|
Loading…
Reference in New Issue