[Tools] Add bsp_directory.
Add bsp_directory for PrepareModuleBuilding function and module building environment can parse rtconfig.h too.
This commit is contained in:
parent
4888957d22
commit
1d23ce6cbd
|
@ -256,7 +256,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||||
|
|
||||||
return objs
|
return objs
|
||||||
|
|
||||||
def PrepareModuleBuilding(env, root_directory):
|
def PrepareModuleBuilding(env, root_directory, bsp_directory):
|
||||||
import rtconfig
|
import rtconfig
|
||||||
|
|
||||||
global Env
|
global Env
|
||||||
|
@ -265,6 +265,14 @@ def PrepareModuleBuilding(env, root_directory):
|
||||||
Env = env
|
Env = env
|
||||||
Rtt_Root = root_directory
|
Rtt_Root = root_directory
|
||||||
|
|
||||||
|
# parse bsp rtconfig.h to get used component
|
||||||
|
PreProcessor = SCons.cpp.PreProcessor()
|
||||||
|
f = file(bsp_directory + '/rtconfig.h', 'r')
|
||||||
|
contents = f.read()
|
||||||
|
f.close()
|
||||||
|
PreProcessor.process_contents(contents)
|
||||||
|
BuildOptions = PreProcessor.cpp_namespace
|
||||||
|
|
||||||
# add build/clean library option for library checking
|
# add build/clean library option for library checking
|
||||||
AddOption('--buildlib',
|
AddOption('--buildlib',
|
||||||
dest='buildlib',
|
dest='buildlib',
|
||||||
|
|
Loading…
Reference in New Issue