浏览代码

simulator: move SDL setting staff into drivers/SConstruct

This could not only make a cleaner SConstruct, but could also benefit
RTGUI building.
Grissiom 11 年之前
父节点
当前提交
c6e81b58d9
共有 2 个文件被更改,包括 11 次插入10 次删除
  1. 0 7
      bsp/simulator/SConstruct
  2. 11 3
      bsp/simulator/drivers/SConscript

+ 0 - 7
bsp/simulator/SConstruct

@@ -84,13 +84,6 @@ else:
 
 
 objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui'])
 objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui'])
 if GetDepend('RT_USING_RTGUI'):
 if GetDepend('RT_USING_RTGUI'):
-    sdl_lib = ['SDL', 'SDLmain']
-    sdl_lib_path = [os.path.abspath('SDL/lib/x86')]
-    sdl_include_path = [os.path.abspath('SDL/include')]
-    env.Append(LIBS=sdl_lib)
-    env.Append(LIBPATH=sdl_lib_path)
-    env.Append(CPPPATH=sdl_include_path)
-
     if RTT_RTGUI:
     if RTT_RTGUI:
         objs += SConscript(os.path.join(RTT_RTGUI, 'SConscript'),
         objs += SConscript(os.path.join(RTT_RTGUI, 'SConscript'),
 						   variant_dir='build/components/rtgui',
 						   variant_dir='build/components/rtgui',

+ 11 - 3
bsp/simulator/drivers/SConscript

@@ -3,10 +3,19 @@ from building import *
 
 
 cwd = GetCurrentDir()
 cwd = GetCurrentDir()
 src = Glob('*.c')
 src = Glob('*.c')
+LIBS = []
+LIBPATH = []
+CPPPATH = [cwd]
 
 
 # remove no need file.
 # remove no need file.
 if GetDepend('RT_USING_RTGUI') == False:
 if GetDepend('RT_USING_RTGUI') == False:
     SrcRemove(src, 'sdl_fb.c')
     SrcRemove(src, 'sdl_fb.c')
+else:
+    LIBS.append('SDL')
+    if sys.platform == 'win32':
+        LIBPATH.append(os.path.abspath(os.path.join(cwd, '../SDL/lib/x86')))
+        CPPPATH.append(os.path.abspath(os.path.join(cwd, '../SDL/include')))
+
 if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_DFS_ELMFAT') == False:
 if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_DFS_ELMFAT') == False:
     SrcRemove(src, 'sd_sim.c')
     SrcRemove(src, 'sd_sim.c')
 if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MTD_NAND') == False:
 if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MTD_NAND') == False:
@@ -20,8 +29,7 @@ if GetDepend('RT_USING_MODULE') == False:
 if sys.platform[0:5]=="linux": #check whether under linux
 if sys.platform[0:5]=="linux": #check whether under linux
     SrcRemove(src, ['module_win32.c', 'dfs_win32.c'])
     SrcRemove(src, ['module_win32.c', 'dfs_win32.c'])
 
 
-CPPPATH = [cwd]
-
-group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
+group = DefineGroup('Drivers', src, depend = [''],
+                    CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH)
 
 
 Return('group')
 Return('group')