mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #1912 from 0xc0170/fix_exporters
Tools/project - project dir should be the listpull/1920/head
commit
6167f23da6
|
@ -19,6 +19,7 @@ from project_generator_definitions.definitions import ProGenDef
|
||||||
|
|
||||||
from tools.export.exporters import Exporter
|
from tools.export.exporters import Exporter
|
||||||
from tools.targets import TARGET_MAP, TARGET_NAMES
|
from tools.targets import TARGET_MAP, TARGET_NAMES
|
||||||
|
from tools.settings import ARM_INC
|
||||||
|
|
||||||
# If you wish to add a new target, add it to project_generator_definitions, and then
|
# If you wish to add a new target, add it to project_generator_definitions, and then
|
||||||
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
|
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
|
||||||
|
@ -67,11 +68,14 @@ class Uvision4(Exporter):
|
||||||
|
|
||||||
# get flags from toolchain and apply
|
# get flags from toolchain and apply
|
||||||
project_data['tool_specific']['uvision']['misc'] = {}
|
project_data['tool_specific']['uvision']['misc'] = {}
|
||||||
project_data['tool_specific']['uvision']['misc']['asm_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['asm']))
|
# asm flags only, common are not valid within uvision project, they are armcc specific
|
||||||
project_data['tool_specific']['uvision']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c']))
|
project_data['tool_specific']['uvision']['misc']['asm_flags'] = list(set(self.toolchain.flags['asm']))
|
||||||
|
# cxx flags included, as uvision have them all in one tab
|
||||||
|
project_data['tool_specific']['uvision']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c'] + self.toolchain.flags['cxx']))
|
||||||
# not compatible with c99 flag set in the template
|
# not compatible with c99 flag set in the template
|
||||||
project_data['tool_specific']['uvision']['misc']['c_flags'].remove("--c99")
|
project_data['tool_specific']['uvision']['misc']['c_flags'].remove("--c99")
|
||||||
project_data['tool_specific']['uvision']['misc']['cxx_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['ld']))
|
# ARM_INC is by default as system inclusion, not required for exported project
|
||||||
|
project_data['tool_specific']['uvision']['misc']['c_flags'].remove("-I \""+ARM_INC+"\"")
|
||||||
project_data['tool_specific']['uvision']['misc']['ld_flags'] = self.toolchain.flags['ld']
|
project_data['tool_specific']['uvision']['misc']['ld_flags'] = self.toolchain.flags['ld']
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|
|
@ -67,11 +67,12 @@ class Uvision5(Exporter):
|
||||||
|
|
||||||
# get flags from toolchain and apply
|
# get flags from toolchain and apply
|
||||||
project_data['tool_specific']['uvision5']['misc'] = {}
|
project_data['tool_specific']['uvision5']['misc'] = {}
|
||||||
project_data['tool_specific']['uvision5']['misc']['asm_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['asm']))
|
# asm flags only, common are not valid within uvision project, they are armcc specific
|
||||||
project_data['tool_specific']['uvision5']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c']))
|
project_data['tool_specific']['uvision5']['misc']['asm_flags'] = list(set(self.toolchain.flags['asm']))
|
||||||
|
# cxx flags included, as uvision have them all in one tab
|
||||||
|
project_data['tool_specific']['uvision5']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c'] + self.toolchain.flags['cxx']))
|
||||||
# not compatible with c99 flag set in the template
|
# not compatible with c99 flag set in the template
|
||||||
project_data['tool_specific']['uvision5']['misc']['c_flags'].remove("--c99")
|
project_data['tool_specific']['uvision5']['misc']['c_flags'].remove("--c99")
|
||||||
project_data['tool_specific']['uvision5']['misc']['cxx_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['ld']))
|
|
||||||
project_data['tool_specific']['uvision5']['misc']['ld_flags'] = self.toolchain.flags['ld']
|
project_data['tool_specific']['uvision5']['misc']['ld_flags'] = self.toolchain.flags['ld']
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|
|
@ -205,12 +205,12 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
# Build the project with the same directory structure of the mbed online IDE
|
# Build the project with the same directory structure of the mbed online IDE
|
||||||
project_name = test.id
|
project_name = test.id
|
||||||
project_dir = join(EXPORT_WORKSPACE, project_name)
|
project_dir = [join(EXPORT_WORKSPACE, project_name)]
|
||||||
project_temp = EXPORT_TMP
|
project_temp = EXPORT_TMP
|
||||||
setup_user_prj(project_dir, test.source_dir, test.dependencies)
|
setup_user_prj(project_dir[0], test.source_dir, test.dependencies)
|
||||||
|
|
||||||
# Export to selected toolchain
|
# Export to selected toolchain
|
||||||
tmp_path, report = export(project_dir, project_name, ide, mcu, project_dir, project_temp, clean=clean, zip=zip, extra_symbols=lib_symbols, relative=sources_relative)
|
tmp_path, report = export(project_dir, project_name, ide, mcu, project_dir[0], project_temp, clean=clean, zip=zip, extra_symbols=lib_symbols, relative=sources_relative)
|
||||||
if report['success']:
|
if report['success']:
|
||||||
zip_path = join(EXPORT_DIR, "%s_%s_%s.zip" % (project_name, ide, mcu))
|
zip_path = join(EXPORT_DIR, "%s_%s_%s.zip" % (project_name, ide, mcu))
|
||||||
if zip:
|
if zip:
|
||||||
|
|
|
@ -35,7 +35,7 @@ class ARM(mbedToolchain):
|
||||||
DEFAULT_FLAGS = {
|
DEFAULT_FLAGS = {
|
||||||
'common': ["-c", "--gnu",
|
'common': ["-c", "--gnu",
|
||||||
"-Otime", "--split_sections", "--apcs=interwork",
|
"-Otime", "--split_sections", "--apcs=interwork",
|
||||||
"--brief_diagnostics", "--restrict", "--multibyte_chars", "-I", "\""+ARM_INC+"\""],
|
"--brief_diagnostics", "--restrict", "--multibyte_chars", "-I \""+ARM_INC+"\""],
|
||||||
'asm': [],
|
'asm': [],
|
||||||
'c': ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
|
'c': ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
|
||||||
'cxx': ["--cpp", "--no_rtti"],
|
'cxx': ["--cpp", "--no_rtti"],
|
||||||
|
|
Loading…
Reference in New Issue