diff options
| author | Man, Jianting (Meco) <[email protected]> | 2022-04-07 02:24:11 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-04-07 14:24:11 +0800 |
| commit | c318dfa964c8967325b945fe851e9554fdae0638 (patch) | |
| tree | 53f0597bf2abe96632ac9c721b7f5f7c19f3fab4 /bsp/simulator/drivers/SConscript | |
| parent | e68f934ff8c83d36f162b80e240e633b58949036 (diff) | |
improve libc time and MSVC simulator (#5775)
- [libc] 解决由于类unix操作系统发展历史原因fcntl.h定义的标志位在不同编译器中定义不同的问题
- [simulator] 部分宏定义转为全局宏定义以确保vs内置文件可以正确配置
- [simulator] 取消自欺欺人式的警告消除处理方式
- [libc][time] 优化time相关结构体在不同编译器下的包含
Diffstat (limited to 'bsp/simulator/drivers/SConscript')
| -rw-r--r-- | bsp/simulator/drivers/SConscript | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/bsp/simulator/drivers/SConscript b/bsp/simulator/drivers/SConscript index 8f0c9275ff..731b577fd3 100644 --- a/bsp/simulator/drivers/SConscript +++ b/bsp/simulator/drivers/SConscript @@ -1,12 +1,29 @@ import sys import os from building import * +Import('rtconfig') cwd = GetCurrentDir() src = Glob('*.c') LIBS = [] LIBPATH = [] CPPPATH = [cwd] +CPPDEFINES = [] + +if rtconfig.CROSS_TOOL == 'msvc': + CPPDEFINES += \ + [ + # avoid to conflict with the inherent STDC in VS + '_CRT_DECLARE_NONSTDC_NAMES=0', + # errno macro redefinition + '_CRT_ERRNO_DEFINED', + # time.h conflicts + '_CRT_NO_TIME_T', + # disable deprecation of unsafe functions, such as strncpy + '_CRT_SECURE_NO_WARNINGS', + # RT_VESRION conflicts in winuser.h + 'NORESOURCE', + ] # remove no need file. if GetDepend('PKG_USING_GUIENGINE') == False: @@ -30,7 +47,8 @@ if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MODULE') == False: if sys.platform[0:5]=="linux": #check whether under linux SrcRemove(src, ['module_win32.c', 'dfs_win32.c']) -group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH) +group = DefineGroup('Drivers', src, depend = [''], + CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH, CPPDEFINES=CPPDEFINES) list = os.listdir(cwd) for item in list: |
