mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #9756 from vmedcy/psoc6-cmake-export
PSOC6: enable export to CMakepull/9774/head
commit
e59166289f
|
@ -44,7 +44,8 @@ class CMake(Exporter):
|
||||||
"MCU_NRF51Code.binary_hook",
|
"MCU_NRF51Code.binary_hook",
|
||||||
"TEENSY3_1Code.binary_hook",
|
"TEENSY3_1Code.binary_hook",
|
||||||
"LPCTargetCode.lpc_patch",
|
"LPCTargetCode.lpc_patch",
|
||||||
"LPC4088Code.binary_hook"
|
"LPC4088Code.binary_hook",
|
||||||
|
"PSOC6Code.complete"
|
||||||
])
|
])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -83,7 +84,7 @@ class CMake(Exporter):
|
||||||
'include_paths': includes,
|
'include_paths': includes,
|
||||||
'library_paths': sorted([re.sub(r'^[.]/', '', l) for l in self.resources.lib_dirs]),
|
'library_paths': sorted([re.sub(r'^[.]/', '', l) for l in self.resources.lib_dirs]),
|
||||||
'linker_script': self.resources.linker_script,
|
'linker_script': self.resources.linker_script,
|
||||||
'hex_files': self.resources.hex_files,
|
'hex_files': self.hex_files,
|
||||||
'ar': basename(self.toolchain.ar),
|
'ar': basename(self.toolchain.ar),
|
||||||
'cc': basename(self.toolchain.cc[0]),
|
'cc': basename(self.toolchain.cc[0]),
|
||||||
'cc_flags': " ".join(flag for flag in self.toolchain.cc[1:] if not flag == "-c"),
|
'cc_flags': " ".join(flag for flag in self.toolchain.cc[1:] if not flag == "-c"),
|
||||||
|
|
|
@ -141,6 +141,15 @@ class Exporter(object):
|
||||||
return [l for l in self.resources.get_file_names(FileType.LIB)
|
return [l for l in self.resources.get_file_names(FileType.LIB)
|
||||||
if l.endswith(self.toolchain.LIBRARY_EXT)]
|
if l.endswith(self.toolchain.LIBRARY_EXT)]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def hex_files(self):
|
||||||
|
"""Returns a list of hex files to include in the exported project"""
|
||||||
|
hex_files = self.resources.hex_files
|
||||||
|
if hasattr(self.toolchain.target, 'hex_filename'):
|
||||||
|
hex_filename = self.toolchain.target.hex_filename
|
||||||
|
hex_files = [f for f in hex_files if basename(f) == hex_filename]
|
||||||
|
return hex_files
|
||||||
|
|
||||||
def toolchain_flags(self, toolchain):
|
def toolchain_flags(self, toolchain):
|
||||||
"""Returns a dictionary of toolchain flags.
|
"""Returns a dictionary of toolchain flags.
|
||||||
Keys of the dictionary are:
|
Keys of the dictionary are:
|
||||||
|
|
|
@ -84,11 +84,6 @@ class Makefile(Exporter):
|
||||||
sys_libs = [self.prepare_sys_lib(lib) for lib
|
sys_libs = [self.prepare_sys_lib(lib) for lib
|
||||||
in self.toolchain.sys_libs]
|
in self.toolchain.sys_libs]
|
||||||
|
|
||||||
hex_files = self.resources.hex_files
|
|
||||||
if hasattr(self.toolchain.target, 'hex_filename'):
|
|
||||||
hex_filename = self.toolchain.target.hex_filename
|
|
||||||
hex_files = list(f for f in hex_files if basename(f) == hex_filename)
|
|
||||||
|
|
||||||
ctx = {
|
ctx = {
|
||||||
'name': self.project_name,
|
'name': self.project_name,
|
||||||
'to_be_compiled': to_be_compiled,
|
'to_be_compiled': to_be_compiled,
|
||||||
|
@ -98,7 +93,7 @@ class Makefile(Exporter):
|
||||||
'linker_script': self.resources.linker_script,
|
'linker_script': self.resources.linker_script,
|
||||||
'libraries': libraries,
|
'libraries': libraries,
|
||||||
'ld_sys_libs': sys_libs,
|
'ld_sys_libs': sys_libs,
|
||||||
'hex_files': hex_files,
|
'hex_files': self.hex_files,
|
||||||
'vpath': (["../../.."]
|
'vpath': (["../../.."]
|
||||||
if (basename(dirname(dirname(self.export_dir)))
|
if (basename(dirname(dirname(self.export_dir)))
|
||||||
== "projectfiles")
|
== "projectfiles")
|
||||||
|
|
Loading…
Reference in New Issue