[cpp] attach CXXFLAGS to reduce the resource consumptions

This commit is contained in:
Meco Man
2023-06-14 00:03:38 -04:00
committed by Man, Jianting (Meco)
parent c4df1d6a19
commit 4f5ba63c7c
4 changed files with 12 additions and 5 deletions

View File

@@ -5,8 +5,13 @@ Import('rtconfig')
cwd = GetCurrentDir()
src = ['cxx_crt_init.c', 'cxx_crt.cpp']
CPPPATH = [cwd]
CXXFLAGS = ''
group = DefineGroup('CPP', src, depend=['RT_USING_CPLUSPLUS'], CPPPATH=CPPPATH)
if rtconfig.PLATFORM in ['gcc', 'armclang', 'llvm-arm'] and not GetDepend('RT_USING_CPP_EXCEPTIONS'):
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)
list = os.listdir(cwd)
for d in list: