MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / PrepareBuilding

Function PrepareBuilding

tools/building.py:51–346  ·  view source on GitHub ↗
(env, root_directory, has_libcpu=False, remove_components = [])

Source from the content-addressed store, hash-verified

49Env = None
50
51def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = []):
52
53 global BuildOptions
54 global Projects
55 global Env
56 global Rtt_Root
57
58 AddOptions()
59
60 Env = env
61 # export the default environment
62 Export('env')
63
64 # prepare logging and set log
65 logging.basicConfig(level=logging.INFO, format="%(message)s")
66 logger = logging.getLogger('rt-scons')
67 if GetOption('verbose'):
68 logger.setLevel(logging.DEBUG)
69 Env['log'] = logger
70
71 Rtt_Root = os.path.abspath(root_directory)
72
73 # make an absolute root directory
74 RTT_ROOT = Rtt_Root
75 Export('RTT_ROOT')
76
77 # set RTT_ROOT in ENV
78 Env['RTT_ROOT'] = Rtt_Root
79 os.environ["RTT_DIR"] = Rtt_Root
80 # set BSP_ROOT in ENV
81 Env['BSP_ROOT'] = Dir('#').abspath
82 os.environ["BSP_DIR"] = Dir('#').abspath
83
84 sys.path += os.path.join(Rtt_Root, 'tools')
85
86 # {target_name:(CROSS_TOOL, PLATFORM)}
87 tgt_dict = {'mdk':('keil', 'armcc'),
88 'mdk4':('keil', 'armcc'),
89 'mdk5':('keil', 'armcc'),
90 'iar':('iar', 'iccarm'),
91 'vs':('msvc', 'cl'),
92 'vs2012':('msvc', 'cl'),
93 'vsc' : ('gcc', 'gcc'),
94 'vsc_workspace':('gcc', 'gcc'),
95 'cb':('keil', 'armcc'),
96 'ua':('gcc', 'gcc'),
97 'cdk':('gcc', 'gcc'),
98 'makefile':('gcc', 'gcc'),
99 'eclipse':('gcc', 'gcc'),
100 'ses' : ('gcc', 'gcc'),
101 'cmake':('gcc', 'gcc'),
102 'cmake-armclang':('keil', 'armclang'),
103 'xmake':('gcc', 'gcc'),
104 'codelite' : ('gcc', 'gcc'),
105 'esp-idf': ('gcc', 'gcc'),
106 'zig':('gcc', 'gcc')}
107 tgt_name = GetOption('target')
108

Callers

nothing calls this directly

Calls 15

AddOptionsFunction · 0.90
Win32SpawnClass · 0.90
GenAttachConfigProjectFunction · 0.90
genconfigFunction · 0.90
menuconfigFunction · 0.90
defconfigFunction · 0.90
guiconfigFunction · 0.90
mk_rtconfigFunction · 0.90
AddDependFunction · 0.85
DefineGroupFunction · 0.70

Tested by

no test coverage detected