Skip to content

Commit 6167f23

Browse files
authored
Merge pull request #1912 from 0xc0170/fix_exporters
Tools/project - project dir should be the list
2 parents 999f798 + 7247150 commit 6167f23

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

tools/export/uvision4.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
from tools.export.exporters import Exporter
2121
from tools.targets import TARGET_MAP, TARGET_NAMES
22+
from tools.settings import ARM_INC
2223

2324
# If you wish to add a new target, add it to project_generator_definitions, and then
2425
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
@@ -67,11 +68,14 @@ def generate(self):
6768

6869
# get flags from toolchain and apply
6970
project_data['tool_specific']['uvision']['misc'] = {}
70-
project_data['tool_specific']['uvision']['misc']['asm_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['asm']))
71-
project_data['tool_specific']['uvision']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c']))
71+
# asm flags only, common are not valid within uvision project, they are armcc specific
72+
project_data['tool_specific']['uvision']['misc']['asm_flags'] = list(set(self.toolchain.flags['asm']))
73+
# cxx flags included, as uvision have them all in one tab
74+
project_data['tool_specific']['uvision']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c'] + self.toolchain.flags['cxx']))
7275
# not compatible with c99 flag set in the template
7376
project_data['tool_specific']['uvision']['misc']['c_flags'].remove("--c99")
74-
project_data['tool_specific']['uvision']['misc']['cxx_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['ld']))
77+
# ARM_INC is by default as system inclusion, not required for exported project
78+
project_data['tool_specific']['uvision']['misc']['c_flags'].remove("-I \""+ARM_INC+"\"")
7579
project_data['tool_specific']['uvision']['misc']['ld_flags'] = self.toolchain.flags['ld']
7680

7781
i = 0

tools/export/uvision5.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ def generate(self):
6767

6868
# get flags from toolchain and apply
6969
project_data['tool_specific']['uvision5']['misc'] = {}
70-
project_data['tool_specific']['uvision5']['misc']['asm_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['asm']))
71-
project_data['tool_specific']['uvision5']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c']))
70+
# asm flags only, common are not valid within uvision project, they are armcc specific
71+
project_data['tool_specific']['uvision5']['misc']['asm_flags'] = list(set(self.toolchain.flags['asm']))
72+
# cxx flags included, as uvision have them all in one tab
73+
project_data['tool_specific']['uvision5']['misc']['c_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['c'] + self.toolchain.flags['cxx']))
7274
# not compatible with c99 flag set in the template
7375
project_data['tool_specific']['uvision5']['misc']['c_flags'].remove("--c99")
74-
project_data['tool_specific']['uvision5']['misc']['cxx_flags'] = list(set(self.toolchain.flags['common'] + self.toolchain.flags['ld']))
7576
project_data['tool_specific']['uvision5']['misc']['ld_flags'] = self.toolchain.flags['ld']
7677

7778
i = 0

tools/project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@
205205

206206
# Build the project with the same directory structure of the mbed online IDE
207207
project_name = test.id
208-
project_dir = join(EXPORT_WORKSPACE, project_name)
208+
project_dir = [join(EXPORT_WORKSPACE, project_name)]
209209
project_temp = EXPORT_TMP
210-
setup_user_prj(project_dir, test.source_dir, test.dependencies)
210+
setup_user_prj(project_dir[0], test.source_dir, test.dependencies)
211211

212212
# Export to selected toolchain
213-
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)
213+
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)
214214
if report['success']:
215215
zip_path = join(EXPORT_DIR, "%s_%s_%s.zip" % (project_name, ide, mcu))
216216
if zip:

tools/toolchains/arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ARM(mbedToolchain):
3535
DEFAULT_FLAGS = {
3636
'common': ["-c", "--gnu",
3737
"-Otime", "--split_sections", "--apcs=interwork",
38-
"--brief_diagnostics", "--restrict", "--multibyte_chars", "-I", "\""+ARM_INC+"\""],
38+
"--brief_diagnostics", "--restrict", "--multibyte_chars", "-I \""+ARM_INC+"\""],
3939
'asm': [],
4040
'c': ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
4141
'cxx': ["--cpp", "--no_rtti"],

0 commit comments

Comments
 (0)