Skip to content

Commit cf8ade0

Browse files
yangjie11mysterywolf
authored andcommitted
为c++增加 rt-thread 多线程支持的子开关
1 parent edaa0d9 commit cf8ade0

File tree

13 files changed

+39
-14
lines changed

13 files changed

+39
-14
lines changed

components/libc/cplusplus/Kconfig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ menuconfig RT_USING_CPLUSPLUS
55
if RT_USING_CPLUSPLUS
66

77
config RT_USING_CPLUSPLUS11
8-
bool "Enable c++11 threading feature support"
8+
bool "Enable C++11 standard multi-threading feature support"
99
default n
1010
select RT_USING_POSIX_FS
1111
select RT_USING_POSIX_STDIO
1212
select RT_USING_PTHREADS
1313
select RT_USING_RTC
1414

15+
config RT_USING_CPP_WRAPPER
16+
bool "Enable RT-Thread APIs C++ wrapper"
17+
default n
18+
1519
endif
Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
# RT-Thread building script for component
2-
31
from building import *
2+
import os
43
Import('rtconfig')
54

6-
cwd = GetCurrentDir()
7-
src = Glob('*.cpp') + Glob('*.c')
5+
cwd = GetCurrentDir()
6+
src = ['cxx_crt_init.c', 'cxx_crt.cpp']
87
CPPPATH = [cwd]
98

10-
if GetDepend('RT_USING_CPLUSPLUS11'):
11-
src += Glob('cpp11/*.cpp') + Glob('cpp11/*.c')
12-
if rtconfig.PLATFORM in ['armclang']:
13-
src += Glob('cpp11/armclang/*.cpp') + Glob('cpp11/armclang/*.c')
14-
CPPPATH += [cwd + '/cpp11/armclang']
15-
elif rtconfig.PLATFORM in ['gcc']:
16-
src += Glob('cpp11/gcc/*.cpp') + Glob('cpp11/gcc/*.c')
17-
CPPPATH += [cwd + '/cpp11/gcc']
9+
group = DefineGroup('CPP', src, depend=['RT_USING_CPLUSPLUS'], CPPPATH=CPPPATH)
1810

19-
group = DefineGroup('CPlusPlus', src, depend = ['RT_USING_CPLUSPLUS'], CPPPATH = CPPPATH)
11+
for d in list:
12+
path = os.path.join(cwd, d)
13+
if os.path.isfile(os.path.join(path, 'SConscript')):
14+
group = group + SConscript(os.path.join(d, 'SConscript'))
2015

2116
Return('group')
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from building import *
2+
Import('rtconfig')
3+
4+
cwd = GetCurrentDir()
5+
src = []
6+
CPPPATH = []
7+
8+
src += Glob('*.cpp') + Glob('*.c')
9+
if rtconfig.PLATFORM in ['armclang']:
10+
src += Glob('armclang/*.cpp') + Glob('armclang/*.c')
11+
CPPPATH += [cwd + '/armclang']
12+
elif rtconfig.PLATFORM in ['gcc']:
13+
src += Glob('gcc/*.cpp') + Glob('gcc/*.c')
14+
CPPPATH += [cwd + '/gcc']
15+
16+
group = DefineGroup('CPP', src, depend=['RT_USING_CPLUSPLUS11'], CPPPATH=CPPPATH)
17+
18+
Return('group')
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from building import *
2+
3+
cwd = GetCurrentDir()
4+
src = Glob('*.cpp')
5+
CPPPATH = [cwd]
6+
group = DefineGroup('CPP', src, depend=['RT_USING_CPP_WRAPPER'], CPPPATH=CPPPATH)
7+
8+
Return('group')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)