-
Notifications
You must be signed in to change notification settings - Fork 3k
Pass only relevant defines at each stage of compilation #2377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,10 +73,12 @@ def generate(self, progen_build=False): | |
|
||
# get flags from toolchain and apply | ||
project_data['tool_specific']['uvision5']['misc'] = {} | ||
# asm flags only, common are not valid within uvision project, they are armcc specific | ||
project_data['tool_specific']['uvision5']['misc']['asm_flags'] = list(set(self.progen_flags['asm_flags'])) | ||
|
||
# need to make this a string got progen. Only adds preprocessor when "macros" set | ||
asm_flag_string = '--cpreproc --cpreproc_opts=-D__ASSERT_MSG,' + ",".join(list(set(self.progen_flags['asm_flags']))) | ||
project_data['tool_specific']['uvision5']['misc']['asm_flags'] = [asm_flag_string] | ||
# cxx flags included, as uvision have them all in one tab | ||
project_data['tool_specific']['uvision5']['misc']['c_flags'] = list(set(self.progen_flags['common_flags'] + self.progen_flags['c_flags'] + self.progen_flags['cxx_flags'])) | ||
project_data['tool_specific']['uvision5']['misc']['c_flags'] = list(set(['-D__ASSERT_MSG']+self.progen_flags['common_flags'] + self.progen_flags['c_flags'] + self.progen_flags['cxx_flags'])) | ||
# not compatible with c99 flag set in the template | ||
project_data['tool_specific']['uvision5']['misc']['c_flags'].remove("--c99") | ||
# cpp is not required as it's implicit for cpp files | ||
|
@@ -85,17 +87,6 @@ def generate(self, progen_build=False): | |
project_data['tool_specific']['uvision5']['misc']['c_flags'].remove("--no_vla") | ||
project_data['tool_specific']['uvision5']['misc']['ld_flags'] = self.progen_flags['ld_flags'] | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this removed? I cant find anything within the commit message, again multiple changes within one commit and no description. I would guess that this macro is not asm anymore ? :-) Please add more details to the commit msg, it will be beneficial for everybody There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Macros are no longer common between asm and cc. |
||
i = 0 | ||
for macro in project_data['common']['macros']: | ||
# armasm does not like floating numbers in macros, timestamp to int | ||
if macro.startswith('MBED_BUILD_TIMESTAMP'): | ||
timestamp = macro[len('MBED_BUILD_TIMESTAMP='):] | ||
project_data['common']['macros'][i] = 'MBED_BUILD_TIMESTAMP=' + str(int(float(timestamp))) | ||
# armasm does not even accept MACRO=string | ||
if macro.startswith('MBED_USERNAME'): | ||
project_data['common']['macros'].pop(i) | ||
i += 1 | ||
project_data['common']['macros'].append('__ASSERT_MSG') | ||
project_data['common']['build_dir'] = project_data['common']['build_dir'] + '\\' + 'uvision5' | ||
if progen_build: | ||
self.progen_gen_file('uvision5', project_data, True) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
--cpreproc --cpreproc_opts
needed? I recall progen does it automatically if macros are defined?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Progen does this if common macros are defined, to be used with armcc and armasm. Because I am trying to distinguish between the two (without editing progen), I wanted to format this entire line to be used in this progen line.