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

Function PrepareModuleBuilding

tools/building.py:348–382  ·  view source on GitHub ↗
(env, root_directory, bsp_directory)

Source from the content-addressed store, hash-verified

346 return objs
347
348def PrepareModuleBuilding(env, root_directory, bsp_directory):
349
350 global BuildOptions
351 global Env
352 global Rtt_Root
353
354 # patch for win32 spawn
355 if env['PLATFORM'] == 'win32':
356 win32_spawn = Win32Spawn()
357 win32_spawn.env = env
358 env['SPAWN'] = win32_spawn.spawn
359
360 Env = env
361 Rtt_Root = root_directory
362
363 # parse bsp rtconfig.h to get used component
364 PreProcessor = create_preprocessor_instance()
365 f = open(bsp_directory + '/rtconfig.h', 'r')
366 contents = f.read()
367 f.close()
368 PreProcessor.process_contents(contents)
369 BuildOptions = PreProcessor.cpp_namespace
370
371 AddOption('--buildlib',
372 dest = 'buildlib',
373 type = 'string',
374 help = 'building library of a component')
375 AddOption('--cleanlib',
376 dest = 'cleanlib',
377 action = 'store_true',
378 default = False,
379 help = 'clean up the library by --buildlib')
380
381 # add program path
382 env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
383
384def GetConfigValue(name):
385 assert type(name) == str, 'GetConfigValue: only string parameter is valid'

Callers

nothing calls this directly

Calls 4

Win32SpawnClass · 0.90
openFunction · 0.50
readMethod · 0.45

Tested by

no test coverage detected