From 0c87e2e7025140ca6105b7fec2639c78c3cd8109 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Thu, 28 Oct 2021 21:02:22 +0100 Subject: Move LTO logic from common.mk (#14973) --- tmk_core/rules.mk | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tmk_core/rules.mk') diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 56a331e288..b17f85d375 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -82,6 +82,15 @@ endif # -Wall...: warning level # -Wa,...: tell GCC to pass this to the assembler. # -adhlns...: create assembler listing +ifeq ($(strip $(LTO_ENABLE)), yes) + ifeq ($(PLATFORM),CHIBIOS) + $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) + $(info If unsure, set LTO_ENABLE = no.) + endif + CDEFS += -flto + CDEFS += -DLTO_ENABLE +endif + DEBUG_ENABLE ?= yes ifeq ($(strip $(SKIP_DEBUG_INFO)),yes) DEBUG_ENABLE=no -- cgit v1.2.3