forked from springcute/rt-thread
[tools][building] Add ASFLAGS in DefineGroup.
This commit is contained in:
parent
7a1f8ee1c4
commit
099062de78
|
@ -4,6 +4,7 @@ from building import *
|
|||
|
||||
comm = rtconfig.ARCH + '/common'
|
||||
path = rtconfig.ARCH + '/' + rtconfig.CPU
|
||||
AFLAGS = ''
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
if rtconfig.PLATFORM == 'armcc':
|
||||
|
@ -21,7 +22,10 @@ if rtconfig.PLATFORM == 'cl':
|
|||
if rtconfig.PLATFORM == 'mingw':
|
||||
src = Glob(path + '/*.c')
|
||||
|
||||
if rtconfig.PLATFORM == 'armcc' and rtconfig.ARCH == 'arm' and rtconfig.CPU == 'arm926':
|
||||
ASFLAGS = ' --cpreproc'
|
||||
|
||||
CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common']
|
||||
group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH)
|
||||
group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH, ASFLAGS = ASFLAGS)
|
||||
|
||||
Return('group')
|
||||
|
|
|
@ -487,6 +487,11 @@ def MergeGroup(src_group, group):
|
|||
src_group['CPPDEFINES'] = src_group['CPPDEFINES'] + group['CPPDEFINES']
|
||||
else:
|
||||
src_group['CPPDEFINES'] = group['CPPDEFINES']
|
||||
if group.has_key('ASFLAGS'):
|
||||
if src_group.has_key('ASFLAGS'):
|
||||
src_group['ASFLAGS'] = src_group['ASFLAGS'] + group['ASFLAGS']
|
||||
else:
|
||||
src_group['ASFLAGS'] = group['ASFLAGS']
|
||||
|
||||
# for local CCFLAGS/CPPPATH/CPPDEFINES
|
||||
if group.has_key('LOCAL_CCFLAGS'):
|
||||
|
@ -520,6 +525,11 @@ def MergeGroup(src_group, group):
|
|||
src_group['LIBPATH'] = src_group['LIBPATH'] + group['LIBPATH']
|
||||
else:
|
||||
src_group['LIBPATH'] = group['LIBPATH']
|
||||
if group.has_key('LOCAL_ASFLAGS'):
|
||||
if src_group.has_key('LOCAL_ASFLAGS'):
|
||||
src_group['LOCAL_ASFLAGS'] = src_group['LOCAL_ASFLAGS'] + group['LOCAL_ASFLAGS']
|
||||
else:
|
||||
src_group['LOCAL_ASFLAGS'] = group['LOCAL_ASFLAGS']
|
||||
|
||||
def DefineGroup(name, src, depend, **parameters):
|
||||
global Env
|
||||
|
@ -550,6 +560,8 @@ def DefineGroup(name, src, depend, **parameters):
|
|||
Env.AppendUnique(CPPDEFINES = group['CPPDEFINES'])
|
||||
if group.has_key('LINKFLAGS'):
|
||||
Env.AppendUnique(LINKFLAGS = group['LINKFLAGS'])
|
||||
if group.has_key('ASFLAGS'):
|
||||
Env.AppendUnique(ASFLAGS = group['ASFLAGS'])
|
||||
|
||||
# check whether to clean up library
|
||||
if GetOption('cleanlib') and os.path.exists(os.path.join(group['path'], GroupLibFullName(name, Env))):
|
||||
|
@ -645,13 +657,14 @@ def DoBuilding(target, objects):
|
|||
|
||||
# handle local group
|
||||
def local_group(group, objects):
|
||||
if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES'):
|
||||
if group.has_key('LOCAL_CCFLAGS') or group.has_key('LOCAL_CPPPATH') or group.has_key('LOCAL_CPPDEFINES') or group.has_key('LOCAL_ASFLAGS'):
|
||||
CCFLAGS = Env.get('CCFLAGS', '') + group.get('LOCAL_CCFLAGS', '')
|
||||
CPPPATH = Env.get('CPPPATH', ['']) + group.get('LOCAL_CPPPATH', [''])
|
||||
CPPDEFINES = Env.get('CPPDEFINES', ['']) + group.get('LOCAL_CPPDEFINES', [''])
|
||||
ASFLAGS = Env.get('ASFLAGS', '') + group.get('LOCAL_ASFLAGS', '')
|
||||
|
||||
for source in group['src']:
|
||||
objects.append(Env.Object(source, CCFLAGS = CCFLAGS,
|
||||
objects.append(Env.Object(source, CCFLAGS = CCFLAGS, ASFLAGS = ASFLAGS,
|
||||
CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES))
|
||||
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue