diff options
author | Joel Challis <git@zvecr.com> | 2021-10-28 21:02:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 21:02:22 +0100 |
commit | 0c87e2e7025140ca6105b7fec2639c78c3cd8109 (patch) | |
tree | bfe242f1216de578f6acc3ff797af781856b3873 /tmk_core | |
parent | 780e763c13052138e4d9ad379c4138c3b2c344a7 (diff) | |
download | qmk_firmware-0c87e2e7025140ca6105b7fec2639c78c3cd8109.tar.gz qmk_firmware-0c87e2e7025140ca6105b7fec2639c78c3cd8109.zip |
Move LTO logic from common.mk (#14973)
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common.mk | 12 | ||||
-rw-r--r-- | tmk_core/rules.mk | 9 |
2 files changed, 9 insertions, 12 deletions
diff --git a/tmk_core/common.mk b/tmk_core/common.mk index f0faa2dc3..ce335f0d3 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk | |||
@@ -100,18 +100,6 @@ ifeq ($(strip $(SHARED_EP_ENABLE)), yes) | |||
100 | TMK_COMMON_DEFS += -DSHARED_EP_ENABLE | 100 | TMK_COMMON_DEFS += -DSHARED_EP_ENABLE |
101 | endif | 101 | endif |
102 | 102 | ||
103 | ifeq ($(strip $(LTO_ENABLE)), yes) | ||
104 | ifeq ($(PLATFORM),CHIBIOS) | ||
105 | $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) | ||
106 | $(info If unsure, set LTO_ENABLE = no.) | ||
107 | endif | ||
108 | EXTRAFLAGS += -flto | ||
109 | TMK_COMMON_DEFS += -DLTO_ENABLE | ||
110 | TMK_COMMON_DEFS += -DLINK_TIME_OPTIMIZATON_ENABLE | ||
111 | else ifdef LINK_TIME_OPTIMIZATION_ENABLE | ||
112 | $(error The LINK_TIME_OPTIMIZATION_ENABLE flag has been renamed to LTO_ENABLE.) | ||
113 | endif | ||
114 | |||
115 | # Search Path | 103 | # Search Path |
116 | VPATH += $(TMK_PATH)/$(COMMON_DIR) | 104 | VPATH += $(TMK_PATH)/$(COMMON_DIR) |
117 | VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) | 105 | VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) |
diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 56a331e28..b17f85d37 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk | |||
@@ -82,6 +82,15 @@ endif | |||
82 | # -Wall...: warning level | 82 | # -Wall...: warning level |
83 | # -Wa,...: tell GCC to pass this to the assembler. | 83 | # -Wa,...: tell GCC to pass this to the assembler. |
84 | # -adhlns...: create assembler listing | 84 | # -adhlns...: create assembler listing |
85 | ifeq ($(strip $(LTO_ENABLE)), yes) | ||
86 | ifeq ($(PLATFORM),CHIBIOS) | ||
87 | $(info Enabling LTO on ChibiOS-targeting boards is known to have a high likelihood of failure.) | ||
88 | $(info If unsure, set LTO_ENABLE = no.) | ||
89 | endif | ||
90 | CDEFS += -flto | ||
91 | CDEFS += -DLTO_ENABLE | ||
92 | endif | ||
93 | |||
85 | DEBUG_ENABLE ?= yes | 94 | DEBUG_ENABLE ?= yes |
86 | ifeq ($(strip $(SKIP_DEBUG_INFO)),yes) | 95 | ifeq ($(strip $(SKIP_DEBUG_INFO)),yes) |
87 | DEBUG_ENABLE=no | 96 | DEBUG_ENABLE=no |