import osfrom building import *import rtconfigcwd = GetCurrentDir()group = []CXXFLAGS = ''LOCAL_CCFLAGS = ''LOCAL_CFLAGS = ''LOCAL_CXXFLAGS = ''strict_cflags = ''strict_cxxflags = ''if rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm']: # GCC or Keil AC6 or Clang/LLVMCXXFLAGS += ' -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections' # reduce resource consumptionLOCAL_CFLAGS += ' -std=gnu99' # enable GNU extension. Cannot use -std=c99, some toolchain like RISC-V GCC doesn't support 'asm' key wordLOCAL_CXXFLAGS += ' -std=c++11' # support C++11, like non-static data member initializersif rtconfig.PLATFORM in ['gcc']: # enable warning (only for GCC)# both C and C++ filesstrict_cflags += ' -Wall -Wextra' # enable all warningstrict_cflags += ' -Wunused -Wunused-parameter -Wunused-function -Wunused-label -Wunused-variable -Wunused-value' # unused warningstrict_cflags += ' -Wformat -Wformat-security' # printf/scanf format warningstrict_cflags += ' -Warray-bounds -Wuninitialized -Wsequence-point' # memory access warningstrict_cflags += ' -Wreturn-type -Wcomment -Wswitch -Wmissing-braces -Wmultichar' # code style warningstrict_cflags += ' -Wparentheses -Wlogical-op -Wsequence-point -Wfloat-equal -Wsign-compare -Wpointer-arith' # operation warning -Wconversionstrict_cflags += ' -Wimplicit-fallthrough' # implicit fallthrough warningstrict_cflags += ' -Wduplicated-cond -Wduplicated-branches -Wunreachable-code' # duplicated code warningstrict_cxxflags += strict_cflags# only for C filesstrict_cflags += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warning# only for C++ files# strict_cxxflags += ' -Wreorder -Wnon-virtual-dtor -Woverloaded-virtual' # virtual function warningelif rtconfig.PLATFORM in ['armcc']: # Keil AC5CXXFLAGS += ' --gnu --c99' # enable global C99 and GNU extension support for the whole projectLOCAL_CCFLAGS += ' --gnu -g -W'LOCAL_CFLAGS += ' --c99' # cannot use --c99 symbol for C++ files, pertically in Keil# LOCAL_CXXFLAGS += ' --cpp11' # support C++11, Keil5 5.38 doesn't support C++11else:print('[RTduino] Unsupported rtconfig.PLATFORM: {}'.format(rtconfig.PLATFORM))Return('group')core_src = Glob('*.c') + Glob('*.cpp') + Glob('avr/*.c')if GetDepend(['RTDUINO_TINY_MODE']):SrcRemove(core_src, ['Tone.cpp', 'WInterrupts.c', 'wiring_analog.c', 'wiring_digital.c', 'wiring_pulse.c', 'wiring_shift.c'])group = group + DefineGroup('RTduino-core', core_src,depend=['PKG_USING_RTDUINO'],CPPPATH=[cwd],CPPDEFINES=['ARDUINO=10819', 'ARDUINO_ARCH_RTTHREAD=10000'],CXXFLAGS=CXXFLAGS,LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CFLAGS=LOCAL_CFLAGS + strict_cflags,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS + strict_cxxflags)# add CFLAGS for arduino_main.cppif not GetDepend(['RTDUINO_NO_SETUP_LOOP']):group = group + DefineGroup('Applications', [],depend=['PKG_USING_RTDUINO'],LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS,LOCAL_CFLAGS=LOCAL_CFLAGS)# pinoutgroup = group + DefineGroup('RTduino-pinout', [],depend=['PKG_USING_RTDUINO'],LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS,LOCAL_CFLAGS=LOCAL_CFLAGS)# buildin librariesgroup = group + DefineGroup('RTduino-libraries-buildin', [],depend=['PKG_USING_RTDUINO'],LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS + strict_cxxflags,LOCAL_CFLAGS=LOCAL_CFLAGS + strict_cflags)# user librariesgroup = group + DefineGroup('RTduino-libraries', [],depend=['PKG_USING_RTDUINO'],LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS,LOCAL_CFLAGS=LOCAL_CFLAGS)# user .ino sketchesgroup = group + DefineGroup('RTduino-sketches', [],depend=['PKG_USING_RTDUINO'],LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS,LOCAL_CFLAGS=LOCAL_CFLAGS)# demosgroup = group + DefineGroup('RTduino-demos', [],depend=['PKG_USING_RTDUINO'],LOCAL_CCFLAGS=LOCAL_CCFLAGS,LOCAL_CXXFLAGS=LOCAL_CXXFLAGS,LOCAL_CFLAGS=LOCAL_CFLAGS)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. 评估模型