Skip to content

Commit

Permalink
[cpp] attach CXXFLAGS to reduce the resource consumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mysterywolf committed Jun 14, 2023
1 parent 593d794 commit 8b80907
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/libc/cplusplus/SConscript
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
from building import *
import os
Import('rtconfig')
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']: # GCC or Keil AC6 or Clang/LLVM
CXXFLAGS += ' -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections' # reduce the resource consumptions

group = DefineGroup('CPP', src, depend=['RT_USING_CPLUSPLUS'], CPPPATH=CPPPATH, CXXFLAGS=CXXFLAGS)

list = os.listdir(cwd)
for d in list:
Expand Down

0 comments on commit 8b80907

Please sign in to comment.