mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-18 09:43:30 +08:00
c318dfa964
- [libc] 解决由于类unix操作系统发展历史原因fcntl.h定义的标志位在不同编译器中定义不同的问题 - [simulator] 部分宏定义转为全局宏定义以确保vs内置文件可以正确配置 - [simulator] 取消自欺欺人式的警告消除处理方式 - [libc][time] 优化time相关结构体在不同编译器下的包含
59 lines
1.9 KiB
Python
59 lines
1.9 KiB
Python
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:
|
|
SrcRemove(src, 'sdl_fb.c')
|
|
else:
|
|
LIBS.append('SDL2')
|
|
if sys.platform == 'win32':
|
|
LIBPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2-2.0.7/lib/x86')))
|
|
CPPPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2-2.0.7/include')))
|
|
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_DFS_ELMFAT') == False:
|
|
SrcRemove(src, 'sd_sim.c')
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MTD_NAND') == False:
|
|
SrcRemove(src, 'nanddrv_file.c')
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MTD_NOR') == False:
|
|
SrcRemove(src, 'sst25vfxx_mtd_sim.c')
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_DFS_WINSHAREDIR') == False:
|
|
SrcRemove(src, 'dfs_win32.c')
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MODULE') == False:
|
|
SrcRemove(src, ['module_win32.c'])
|
|
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, CPPDEFINES=CPPDEFINES)
|
|
|
|
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')
|