2012-10-21 12:33:52 +08:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import rtconfig
|
|
|
|
|
|
|
|
if os.getenv('RTT_ROOT'):
|
|
|
|
RTT_ROOT = os.getenv('RTT_ROOT')
|
|
|
|
else:
|
|
|
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
|
|
|
|
2012-11-16 12:28:24 +08:00
|
|
|
if os.getenv('RTT_RTGUI'):
|
|
|
|
RTT_RTGUI = os.getenv('RTT_RTGUI')
|
|
|
|
else:
|
|
|
|
# set the rtgui root directory by hand
|
|
|
|
# empty string means use the RTGUI in svn
|
2012-11-23 22:05:39 +08:00
|
|
|
# RTT_RTGUI = os.path.normpath(r'F:\Project\git\rt-gui\components\rtgui')
|
2012-11-16 12:28:24 +08:00
|
|
|
RTT_RTGUI =''
|
2012-11-16 00:31:51 +08:00
|
|
|
|
2012-10-21 12:33:52 +08:00
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
TARGET = 'rtthread-win32.' + rtconfig.TARGET_EXT
|
|
|
|
|
|
|
|
env = Environment()
|
|
|
|
|
|
|
|
Export('RTT_ROOT')
|
|
|
|
Export('rtconfig')
|
|
|
|
|
|
|
|
libs = Split('''
|
|
|
|
winmm
|
|
|
|
gdi32
|
|
|
|
winspool
|
|
|
|
comdlg32
|
|
|
|
advapi32
|
|
|
|
shell32
|
|
|
|
ole32
|
|
|
|
oleaut32
|
|
|
|
uuid
|
|
|
|
odbc32
|
|
|
|
odbccp32
|
|
|
|
''')
|
2012-11-07 13:32:29 +08:00
|
|
|
definitions = Split('''
|
|
|
|
WIN32
|
|
|
|
_DEBUG
|
|
|
|
_CONSOLE
|
|
|
|
MSVC
|
|
|
|
_TIME_T_DEFINED
|
|
|
|
''')
|
2012-10-21 12:33:52 +08:00
|
|
|
|
|
|
|
env.Append(CCFLAGS=rtconfig.CFLAGS)
|
|
|
|
env.Append(LINKFLAGS=rtconfig.LFLAGS)
|
|
|
|
env['LIBS']=libs
|
2012-11-07 13:32:29 +08:00
|
|
|
env['CPPDEFINES']=definitions
|
2012-10-21 12:33:52 +08:00
|
|
|
|
2012-11-16 00:31:51 +08:00
|
|
|
# prepare building environment
|
2012-10-21 12:33:52 +08:00
|
|
|
|
2012-11-16 12:28:24 +08:00
|
|
|
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui'])
|
2012-10-21 12:33:52 +08:00
|
|
|
if GetDepend('RT_USING_RTGUI'):
|
2012-11-16 00:31:51 +08:00
|
|
|
sdl_lib = ['SDL', 'SDLmain']
|
2012-11-16 14:42:28 +08:00
|
|
|
sdl_lib_path = [os.path.abspath('SDL/lib/x86')]
|
|
|
|
sdl_include_path = [os.path.abspath('SDL/include')]
|
2012-11-16 00:31:51 +08:00
|
|
|
env.Append(LIBS=sdl_lib)
|
|
|
|
env.Append(LIBPATH=sdl_lib_path)
|
|
|
|
env.Append(CPPPATH=sdl_include_path)
|
|
|
|
|
|
|
|
if RTT_RTGUI:
|
2012-11-18 16:17:25 +08:00
|
|
|
objs += SConscript(os.path.join(RTT_RTGUI, 'SConscript'),
|
2012-11-16 12:28:24 +08:00
|
|
|
variant_dir='build/components/rtgui',
|
|
|
|
duplicate=0)
|
2012-11-18 16:17:25 +08:00
|
|
|
objs = objs + SConscript(RTT_RTGUI+'/../../demo/examples/SConscript',
|
2012-11-16 00:31:51 +08:00
|
|
|
variant_dir='build/examples/gui', duplicate=0)
|
|
|
|
else:
|
2012-11-16 12:28:24 +08:00
|
|
|
objs += SConscript(os.path.join(RTT_ROOT + '/components/rtgui', 'SConscript'),
|
|
|
|
variant_dir='build/components/rtgui',
|
|
|
|
duplicate=0)
|
2012-11-16 00:31:51 +08:00
|
|
|
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript',
|
|
|
|
variant_dir='build/examples/gui', duplicate=0)
|
2012-10-21 12:33:52 +08:00
|
|
|
|
|
|
|
# build program
|
|
|
|
env.Program(TARGET, objs)
|
|
|
|
|
|
|
|
# end building
|
|
|
|
EndBuilding(TARGET)
|