Merge pull request #5542 from mysterywolf/keil

[sconscript.platform] 优化针对编译器判断
This commit is contained in:
Bernard Xiong 2022-01-20 21:01:00 +08:00 committed by GitHub
commit b5de986122
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 12 deletions

View File

@ -10,13 +10,12 @@ src += Glob('*.c')
CPPPATH = [cwd]
LOCAL_CFLAGS = ''
if rtconfig.CROSS_TOOL == 'gcc':
if rtconfig.PLATFORM == 'gcc':
LOCAL_CFLAGS += ' -std=c99'
elif rtconfig.PLATFORM == 'armcc':
LOCAL_CFLAGS += ' --c99'
elif rtconfig.PLATFORM == 'armclang':
LOCAL_CFLAGS += ' -std=c99'
elif rtconfig.CROSS_TOOL == 'keil':
if rtconfig.PLATFORM == 'armcc':
LOCAL_CFLAGS += ' --c99'
elif rtconfig.PLATFORM == 'armclang':
LOCAL_CFLAGS += ' -std=c99'
group = DefineGroup('FAL', src, depend = ['PKG_USING_FAL'], CPPPATH = CPPPATH, LOCAL_CFLAGS = LOCAL_CFLAGS)

View File

@ -25,13 +25,13 @@ if GetDepend('RT_USING_SFUD'):
CPPPATH += [cwd + '/sfud/inc']
if GetDepend('RT_SFUD_USING_SFDP'):
src_device += ['sfud/src/sfud_sfdp.c']
if rtconfig.CROSS_TOOL == 'gcc':
if rtconfig.PLATFORM == 'gcc':
LOCAL_CFLAGS += ' -std=c99'
elif rtconfig.PLATFORM == 'armcc':
LOCAL_CFLAGS += ' --c99'
elif rtconfig.PLATFORM == 'armclang':
LOCAL_CFLAGS += ' -std=c99'
elif rtconfig.CROSS_TOOL == 'keil':
if rtconfig.PLATFORM == 'armcc':
LOCAL_CFLAGS += ' --c99'
elif rtconfig.PLATFORM == 'armclang':
LOCAL_CFLAGS += ' -std=c99'
src += src_device