mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-06 00:45:22 +08:00
[tools] Add --add-rtconfig args for scons when you want to add macro definitions build time.
This commit is contained in:
@@ -319,6 +319,19 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||
if rtconfig.PLATFORM in ['gcc'] and str(env['LINKFLAGS']).find('nano.specs') != -1:
|
||||
env.AppendUnique(CPPDEFINES = ['_REENT_SMALL'])
|
||||
|
||||
add_rtconfig = GetOption('add_rtconfig')
|
||||
if add_rtconfig:
|
||||
add_rtconfig = add_rtconfig.split(',')
|
||||
if isinstance(add_rtconfig, list):
|
||||
for config in add_rtconfig:
|
||||
if isinstance(config, str):
|
||||
AddDepend(add_rtconfig)
|
||||
env.Append(CFLAGS=' -D' + config, CXXFLAGS=' -D' + config, AFLAGS=' -D' + config)
|
||||
else:
|
||||
print('add_rtconfig arguements are illegal!')
|
||||
else:
|
||||
print('add_rtconfig arguements are illegal!')
|
||||
|
||||
if GetOption('genconfig'):
|
||||
from genconf import genconfig
|
||||
genconfig()
|
||||
@@ -1051,3 +1064,4 @@ def PackageSConscript(package):
|
||||
from package import BuildPackage
|
||||
|
||||
return BuildPackage(package)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user