Browse Source

[DeviceDrivers] support using RT_USING_MTD_NOR and RT_USING_MTD_NAND at the same time

tanek liang 7 years ago
parent
commit
99e5e90c40
1 changed files with 11 additions and 10 deletions
  1. 11 10
      components/drivers/mtd/SConscript

+ 11 - 10
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)
+    src += ['mtd_nor.c']
+    depend += ['RT_USING_MTD_NOR']
+
 if GetDepend(['RT_USING_MTD_NAND']):
-    src = src + mtd_nand
-    group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_MTD_NAND'], CPPPATH = CPPPATH)
+    src += ['mtd_nand.c']
+    depend += ['RT_USING_MTD_NAND']
+
+if src:
+    group = DefineGroup('DeviceDrivers', src, depend = depend, CPPPATH = CPPPATH)
 
-Return('group')
+Return('group')