From 884218588ae6a68ed923e4a9774f2ea4d76b90db Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 19 Jan 2022 23:24:47 -0500 Subject: [PATCH] =?UTF-8?q?[sconscript.platform]=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=92=88=E5=AF=B9=E7=BC=96=E8=AF=91=E5=99=A8=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=9A=84=E8=84=9A=E6=9C=AC=20-=20=E5=88=A0=E9=99=A4=E5=95=B0?= =?UTF-8?q?=E5=97=A6=E7=9A=84=E4=BB=A3=E7=A0=81=20related:=20https://githu?= =?UTF-8?q?b.com/RT-Thread/rt-thread/issues/3046?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stm32l475-atk-pandora/board/ports/fal/SConscript | 11 +++++------ components/drivers/spi/SConscript | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bsp/stm32/stm32l475-atk-pandora/board/ports/fal/SConscript b/bsp/stm32/stm32l475-atk-pandora/board/ports/fal/SConscript index 4a53bd1c97..2b71fcc93c 100644 --- a/bsp/stm32/stm32l475-atk-pandora/board/ports/fal/SConscript +++ b/bsp/stm32/stm32l475-atk-pandora/board/ports/fal/SConscript @@ -10,13 +10,12 @@ src += Glob('*.c') CPPPATH = [cwd] LOCAL_CCFLAGS = '' -if rtconfig.CROSS_TOOL == 'gcc': +if rtconfig.PLATFORM == 'gcc': + LOCAL_CCFLAGS += ' -std=c99' +elif rtconfig.PLATFORM == 'armcc': + LOCAL_CCFLAGS += ' --c99' +elif rtconfig.PLATFORM == 'armclang': LOCAL_CCFLAGS += ' -std=c99' -elif rtconfig.CROSS_TOOL == 'keil': - if rtconfig.PLATFORM == 'armcc': - LOCAL_CCFLAGS += ' --c99' - elif rtconfig.PLATFORM == 'armclang': - LOCAL_CCFLAGS += ' -std=c99' group = DefineGroup('FAL', src, depend = ['PKG_USING_FAL'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS) diff --git a/components/drivers/spi/SConscript b/components/drivers/spi/SConscript index d6cb93f7f1..f1c2bd343d 100644 --- a/components/drivers/spi/SConscript +++ b/components/drivers/spi/SConscript @@ -25,13 +25,12 @@ 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_CCFLAGS += ' -std=c99' + elif rtconfig.PLATFORM == 'armcc': + LOCAL_CCFLAGS += ' --c99' + elif rtconfig.PLATFORM == 'armclang': LOCAL_CCFLAGS += ' -std=c99' - elif rtconfig.CROSS_TOOL == 'keil': - if rtconfig.PLATFORM == 'armcc': - LOCAL_CCFLAGS += ' --c99' - elif rtconfig.PLATFORM == 'armclang': - LOCAL_CCFLAGS += ' -std=c99' src += src_device