mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-02-18 18:39:11 +08:00
[tools] Add --add-rtconfig
args for scons when you want to add macro definitions build time.
This commit is contained in:
parent
6c093ad654
commit
f458d63d5f
@ -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:
|
if rtconfig.PLATFORM in ['gcc'] and str(env['LINKFLAGS']).find('nano.specs') != -1:
|
||||||
env.AppendUnique(CPPDEFINES = ['_REENT_SMALL'])
|
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'):
|
if GetOption('genconfig'):
|
||||||
from genconf import genconfig
|
from genconf import genconfig
|
||||||
genconfig()
|
genconfig()
|
||||||
@ -1051,3 +1064,4 @@ def PackageSConscript(package):
|
|||||||
from package import BuildPackage
|
from package import BuildPackage
|
||||||
|
|
||||||
return BuildPackage(package)
|
return BuildPackage(package)
|
||||||
|
|
||||||
|
@ -127,6 +127,10 @@ def AddOptions():
|
|||||||
action = 'store_true',
|
action = 'store_true',
|
||||||
default = False,
|
default = False,
|
||||||
help = 'Don`t show pyconfig window')
|
help = 'Don`t show pyconfig window')
|
||||||
|
AddOption('--add-rtconfig',
|
||||||
|
dest = 'add_rtconfig',
|
||||||
|
type = 'string',
|
||||||
|
help = 'Add macro definitions and scons depend at build time. It is similar to adding macro definitions in rtconfig.h')
|
||||||
if platform.system() != 'Windows':
|
if platform.system() != 'Windows':
|
||||||
AddOption('--menuconfig',
|
AddOption('--menuconfig',
|
||||||
dest = 'menuconfig',
|
dest = 'menuconfig',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user