from building import *import ossrc = Glob('*.c')cwd = GetCurrentDir()inc = [os.path.join(cwd, '..', 'include')]if GetDepend('RT_USING_SMALL_MEM') == False:SrcRemove(src, ['mem.c'])if GetDepend('RT_USING_SLAB') == False:SrcRemove(src, ['slab.c'])if GetDepend('RT_USING_MEMPOOL') == False:SrcRemove(src, ['mempool.c'])if GetDepend('RT_USING_MEMHEAP') == False:SrcRemove(src, ['memheap.c'])if GetDepend('RT_USING_SIGNALS') == False:SrcRemove(src, ['signal.c'])if GetDepend('RT_USING_DEVICE') == False:SrcRemove(src, ['device.c'])if GetDepend('RT_USING_SMP') == False:SrcRemove(src, ['cpu_mp.c', 'scheduler_mp.c'])else:SrcRemove(src, ['cpu_up.c', 'scheduler_up.c'])LOCAL_CFLAGS = ''LINKFLAGS = ''if rtconfig.PLATFORM in ['gcc']: # only for GCCLOCAL_CFLAGS += ' -Wunused' # unused warningLOCAL_CFLAGS += ' -Wformat -Wformat-security' # printf/scanf format warningLOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warningLOCAL_CFLAGS += ' -Wreturn-type -Wcomment -Wswitch' # code style warningLOCAL_CFLAGS += ' -Wparentheses -Wlogical-op ' # operation warningLOCAL_CFLAGS += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warningif 'mips' not in rtconfig.PREFIX: # mips toolchain does not supportLOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warningLOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warningif rtconfig.ARCH not in ['sim']:LINKFLAGS += ' -Wl,--gc-sections,--print-memory-usage' # remove unused sections and print memory usageif GetDepend('RT_USING_HOOKLIST') == True:if rtconfig.PLATFORM in ['gcc', 'armclang']:LOCAL_CFLAGS += ' -std=gnu99'elif rtconfig.PLATFORM in ['armcc']:LOCAL_CFLAGS += ' --c99 --gnu'if rtconfig.CROSS_TOOL == 'msvc':group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc,LINKFLAGS=LINKFLAGS, LOCAL_CFLAGS=LOCAL_CFLAGS,CPPDEFINES=['__RTTHREAD__', '__RT_KERNEL_SOURCE__'])else:group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc,LINKFLAGS=LINKFLAGS, LOCAL_CFLAGS=LOCAL_CFLAGS,CPPDEFINES=['__RTTHREAD__'], LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])list = os.listdir(cwd)for item in list:if os.path.isfile(os.path.join(cwd, item, 'SConscript')):group = group + SConscript(os.path.join(item, 'SConscript'))Return('group')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型