From 0240b5d7be3e732795b6dd50c5e11a5bf3e6e258 Mon Sep 17 00:00:00 2001 From: jzlv Date: Thu, 13 Jan 2022 16:45:27 +0800 Subject: [PATCH] [chore][cmake] change Os to O2,add -Wtype-limits c flag --- tools/cmake/compiler_flags.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/cmake/compiler_flags.cmake b/tools/cmake/compiler_flags.cmake index 55829408..8269b010 100644 --- a/tools/cmake/compiler_flags.cmake +++ b/tools/cmake/compiler_flags.cmake @@ -1,7 +1,8 @@ -list(APPEND GLOBAL_C_FLAGS -Os -g3) +list(APPEND GLOBAL_C_FLAGS -O2 -g3) list(APPEND GLOBAL_C_FLAGS -fno-jump-tables -fshort-enums -fno-common -fms-extensions -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -ffast-math) list(APPEND GLOBAL_C_FLAGS -Wall -Wshift-negative-value -Wchar-subscripts -Wformat -Wuninitialized -Winit-self -Wignored-qualifiers -Wunused -Wundef) list(APPEND GLOBAL_C_FLAGS -msmall-data-limit=4) +list(APPEND GLOBAL_C_FLAGS -Wtype-limits) list(APPEND GLOBAL_LD_FLAGS -Wl,--cref -Wl,--gc-sections -nostartfiles -g3) list(APPEND GLOBAL_LD_FLAGS -fms-extensions -ffunction-sections -fdata-sections)