From 99e5e90c40cd8a2cdbf5e809a81d84310d857fae Mon Sep 17 00:00:00 2001 From: tanek liang Date: Thu, 9 Nov 2017 14:54:07 +0800 Subject: [PATCH] [DeviceDrivers] support using RT_USING_MTD_NOR and RT_USING_MTD_NAND at the same time --- components/drivers/mtd/SConscript | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/components/drivers/mtd/SConscript b/components/drivers/mtd/SConscript index b9aac09b4b..bc2bd54218 100644 --- a/components/drivers/mtd/SConscript +++ b/components/drivers/mtd/SConscript @@ -3,20 +3,21 @@ Import('rtconfig') from building import * cwd = GetCurrentDir() -src = [] - -mtd_nor = ['mtd_nor.c'] - -mtd_nand = ['mtd_nand.c'] +src = [] +depend = [] CPPPATH = [cwd + '/../include'] group = [] if GetDepend(['RT_USING_MTD_NOR']): - src = src + mtd_nor - group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_MTD_NOR'], CPPPATH = CPPPATH) -if GetDepend(['RT_USING_MTD_NAND']): - src = src + mtd_nand - group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_MTD_NAND'], CPPPATH = CPPPATH) + src += ['mtd_nor.c'] + depend += ['RT_USING_MTD_NOR'] -Return('group') +if GetDepend(['RT_USING_MTD_NAND']): + src += ['mtd_nand.c'] + depend += ['RT_USING_MTD_NAND'] + +if src: + group = DefineGroup('DeviceDrivers', src, depend = depend, CPPPATH = CPPPATH) + +Return('group') \ No newline at end of file