2014-11-01 09:09:21 +08:00
|
|
|
from building import *
|
2023-08-21 01:26:39 +08:00
|
|
|
from gcc import *
|
2023-06-12 14:32:48 +08:00
|
|
|
import os
|
2021-09-03 11:38:48 +08:00
|
|
|
Import('rtconfig')
|
2014-11-01 09:09:21 +08:00
|
|
|
|
2023-06-12 14:32:48 +08:00
|
|
|
cwd = GetCurrentDir()
|
|
|
|
src = ['cxx_crt_init.c', 'cxx_crt.cpp']
|
2022-08-15 22:32:27 +08:00
|
|
|
CPPPATH = [cwd]
|
2023-06-14 12:03:38 +08:00
|
|
|
CXXFLAGS = ''
|
2017-01-31 13:19:18 +08:00
|
|
|
|
2023-08-21 01:26:39 +08:00
|
|
|
if rtconfig.PLATFORM in GetGCCLikePLATFORM() and not GetDepend('RT_USING_CPP_EXCEPTIONS'):
|
2023-06-14 12:03:38 +08:00
|
|
|
CXXFLAGS += ' -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections' # reduce resource consumptions
|
|
|
|
|
|
|
|
group = DefineGroup('CPP', src, depend=['RT_USING_CPLUSPLUS'], CPPPATH=CPPPATH, CXXFLAGS=CXXFLAGS)
|
2021-09-03 11:38:48 +08:00
|
|
|
|
2023-06-12 14:32:48 +08:00
|
|
|
list = os.listdir(cwd)
|
|
|
|
for d in list:
|
|
|
|
path = os.path.join(cwd, d)
|
|
|
|
if os.path.isfile(os.path.join(path, 'SConscript')):
|
|
|
|
group = group + SConscript(os.path.join(d, 'SConscript'))
|
2014-11-01 09:09:21 +08:00
|
|
|
|
2023-01-09 10:14:23 +08:00
|
|
|
Return('group')
|