1 Star 0 Fork 2.1K

搬砖现场/rt-thread

forked from RT-Thread/rt-thread 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
SConscript 1.90 KB
一键复制 编辑 原始数据 按行查看 历史
Shell 提交于 2024-04-19 10:45 . add cpu up
from building import *
import os
src = Glob('*.c')
src += Glob('klibc/*.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 GCC
LOCAL_CFLAGS += ' -Wunused' # unused warning
LOCAL_CFLAGS += ' -Wformat -Wformat-security' # printf/scanf format warning
LOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warning
LOCAL_CFLAGS += ' -Wreturn-type -Wcomment -Wswitch' # code style warning
LOCAL_CFLAGS += ' -Wparentheses -Wlogical-op ' # operation warning
LOCAL_CFLAGS += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warning
if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support
LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning
if rtconfig.ARCH not in ['sim']:
LINKFLAGS += ' -Wl,--gc-sections,--print-memory-usage' # remove unused sections and print memory usage
group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc,
LINKFLAGS=LINKFLAGS, LOCAL_CFLAGS=LOCAL_CFLAGS,
CPPDEFINES=['__RTTHREAD__'], LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
Return('group')
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/zhaowx_admin/rt-thread.git
git@gitee.com:zhaowx_admin/rt-thread.git
zhaowx_admin
rt-thread
rt-thread
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385