Home | History | Annotate | Download | only in build
      1 #
      2 # Common global compiler configuration
      3 #
      4 
      5 # Common Compiler Flags ########################################################
      6 
      7 # CHRE requires C++11 and C99 support.
      8 COMMON_CXX_CFLAGS += -std=c++11
      9 COMMON_C_CFLAGS += -x c
     10 COMMON_C_CFLAGS += -std=c99
     11 
     12 # Configure 'all' and 'extra' warnings and promote warnings to errors.
     13 COMMON_CFLAGS += -Wall
     14 COMMON_CFLAGS += -Wextra
     15 COMMON_CFLAGS += -Werror
     16 
     17 # Disabled warnings. You better have a good reason to add more here.
     18 COMMON_CFLAGS += -Wno-unused-parameter
     19 
     20 # Additional warnings. Even more! :]
     21 COMMON_CFLAGS += -Wshadow
     22 COMMON_CFLAGS += -Wdouble-promotion
     23 
     24 # Disable exceptions and RTTI.
     25 COMMON_CXX_CFLAGS += -fno-exceptions
     26 COMMON_CXX_CFLAGS += -fno-rtti
     27 
     28 # Enable the linker to garbage collect unused code and variables.
     29 COMMON_CFLAGS += -fdata-sections
     30 COMMON_CFLAGS += -ffunction-sections
     31 
     32 # Enable debugging symbols for debug builds.
     33 COMMON_DEBUG_CFLAGS += -g
     34 
     35 # Dependency Resolution
     36 DEP_CFLAGS = -MM -MG -MP -MF $$(basename $$@).d
     37 
     38 # Compile with hidden visibility by default.
     39 COMMON_CFLAGS += -fvisibility=hidden
     40 
     41 # Common Archive Flags #########################################################
     42 
     43 COMMON_ARFLAGS += rsc
     44