diff options
| author | Meco Man <[email protected]> | 2023-06-14 00:03:38 -0400 |
|---|---|---|
| committer | Man, Jianting (Meco) <[email protected]> | 2023-06-14 08:49:33 -0400 |
| commit | 4f5ba63c7c94b37515c2b3f3c4ae423585795d0c (patch) | |
| tree | 865bf3b9674a33ad4daf93f994decc3adb6bbb27 /components/libc/cplusplus/SConscript | |
| parent | c4df1d6a19c2ab9c67b42150adb81f49757b6f8c (diff) | |
[cpp] attach CXXFLAGS to reduce the resource consumptions
Diffstat (limited to 'components/libc/cplusplus/SConscript')
| -rw-r--r-- | components/libc/cplusplus/SConscript | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/components/libc/cplusplus/SConscript b/components/libc/cplusplus/SConscript index a7829cea6d..2f280892f4 100644 --- a/components/libc/cplusplus/SConscript +++ b/components/libc/cplusplus/SConscript @@ -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: |
