From 0dea1a8b17f6bb66ce78a97b188cb4c83c3a5d68 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Fri, 1 Nov 2019 06:34:40 +0000 Subject: [PATCH] buildsystem: optimize for size when building with debug --- config/functions | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/functions b/config/functions index fa14e0e8e6..80b7ea4773 100644 --- a/config/functions +++ b/config/functions @@ -222,14 +222,17 @@ setup_toolchain() { fi # compiler optimization, descending priority: speed, size, default - if flag_enabled "speed" "no"; then + if [ "${BUILD_WITH_DEBUG}" = "yes" ]; then + TARGET_CFLAGS+=" $CFLAGS_OPTIM_SIZE" + TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_SIZE" + elif flag_enabled "speed" "no"; then TARGET_CFLAGS+=" $CFLAGS_OPTIM_SPEED" TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_SPEED" elif flag_enabled "size" "no"; then TARGET_CFLAGS+=" $CFLAGS_OPTIM_SIZE" TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_SIZE" else - TARGET_CFLAGS+=" $CXXFLAGS_OPTIM_DEFAULT" + TARGET_CFLAGS+=" $CFLAGS_OPTIM_DEFAULT" TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_DEFAULT" fi