提交 8cf479ca 编写于 作者: C chaos.proton@gmail.com

add "remove_components" feature

If one do not want to use some components in the RTT_ROOT, it can pass a remove_components=['the_component'] parameter to PrepareBuilding. Sample code is:

RTT_RTGUI = os.getenv('RTT_RTGUI')
# if GUI dir is set to other place, don't use the one in RTT_ROOT
if RTT_RTGUI:
    # prepare building environment
    objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False, remove_components=['rtgui'])
    objs += SConscript(os.path.join(RTT_RTGUI, 'SConscript'))
else:
    objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)

You can safely omit the parameter if you do not want to remove any components.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2227 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 0b1f7487
# for module compiling
import os
Import('RTT_ROOT')
Import('remove_components')
objs = []
list = os.listdir(os.path.join(RTT_ROOT, 'components'))
for d in list:
if d in remove_components:
continue
path = os.path.join(RTT_ROOT, 'components', d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
......
......@@ -58,7 +58,7 @@ def GetVersion():
return '0.%d.%d' % (version, subversion)
def PrepareBuilding(env, root_directory, has_libcpu=False):
def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = []):
import SCons.cpp
import rtconfig
......@@ -122,8 +122,12 @@ def PrepareBuilding(env, root_directory, has_libcpu=False):
# include libcpu
if not has_libcpu:
objs.append(SConscript(Rtt_Root + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0))
# include components
objs.append(SConscript(Rtt_Root + '/components/SConscript', variant_dir='build/components', duplicate=0))
objs.append(SConscript(Rtt_Root + '/components/SConscript',
variant_dir='build/components',
duplicate=0,
exports='remove_components'))
return objs
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册